mpflag

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2025 License: MIT Imports: 2 Imported by: 5 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

mango-pflag

Latest Release Software License Build Status Go ReportCard Go Doc

pflag adapter for mango.

Example

import (
    "fmt"

    "github.com/muesli/mango"
    mpflag "github.com/muesli/mango-pflag"
    "github.com/muesli/roff"
    flag "github.com/spf13/pflag"
)

func main() {
    flag.Parse()

    manPage := mango.NewManPage(1, "mango", "a man-page generator").
        WithLongDescription("mango is a man-page generator for Go.").
        WithSection("Copyright", "(C) 2022 Christian Muehlhaeuser.\n"+
            "Released under MIT license.")

    flag.VisitAll(mpflag.PFlagVisitor(manPage))
    fmt.Println(manPage.Build(roff.NewDocument()))
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PFlagCommandVisitor

func PFlagCommandVisitor(c *mango.Command) func(*pflag.Flag)

PFlagCommandVisitor is used to visit all flags and track them in a mango.Command.

func PFlagVisitor

func PFlagVisitor(m *mango.ManPage) func(*pflag.Flag)

PFlagVisitor is used to visit all flags and track them in a mango.ManPage.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址