Categorygithub.com/itsdalmo/cli
modulepackage
0.0.2
Repository: https://github.com/itsdalmo/cli.git
Documentation: pkg.go.dev

# README

CLI

A minimal package for building CLIs in Go, built around spf13/pflag with inspiration from existing CLI packages.

go.dev reference latest release build status code quality

TODO

  • Add validation for redeclared flag names (and shorthand) in subcommands (instead of pflag panic).
  • Print global flags in a separate section under usage.
  • Generate more flag types :D
  • Validate arguments based on Usage? E.g. command <in> <out> could validate that two positional arguments exist during parse?

# Packages

No description provided by the author

# Functions

ResolveMissingFlags iterates over all missing flags in the given pflag.FlagSet and applies each FlagResolver in turn until the the flag is resolved.

# Structs

BoolFlag is used to define a pflag.FlagSet.BoolP flag.
BoolSliceFlag is used to define a pflag.FlagSet.BoolSliceP flag.
Command ...
Context ...
DurationFlag is used to define a pflag.FlagSet.DurationP flag.
DurationSliceFlag is used to define a pflag.FlagSet.DurationSliceP flag.
EnvVarResolver implements FlagResolver by resolving variables from the environment.
ErrMisconfigured is returned when a Command is misconfigured.
IntFlag is used to define a pflag.FlagSet.IntP flag.
IntSliceFlag is used to define a pflag.FlagSet.IntSliceP flag.
Options ...
StringFlag is used to define a pflag.FlagSet.StringP flag.
StringSliceFlag is used to define a pflag.FlagSet.StringSliceP flag.

# Interfaces

Flag is the interface implemented by all flag types.
FlagResolver is the interface implemented by custom flag resolvers.