Skip to content

Releases: urfave/cli

v1.17.0

09 May 15:15
Compare
Choose a tag to compare

Added

  • Pluggable flag-level help text rendering via cli.DefaultFlagStringFunc
  • context.GlobalBoolT was added as an analogue to context.GlobalBool
  • Support for hiding commands by setting Hidden: true -- this will hide the
    commands in help output

Changed

  • Float64Flag, IntFlag, and DurationFlag default values are no longer
    quoted in help text output.
  • All flag types now include (default: {value}) strings following usage when a
    default value can be (reasonably) detected.
  • IntSliceFlag and StringSliceFlag usage strings are now more consistent
    with non-slice flag types
  • Apps now exit with a code of 3 if an unknown subcommand is specified
    (previously they printed "No help topic for...", but still exited 0. This
    makes it easier to script around apps built using cli since they can trust
    that a 0 exit code indicated a successful execution.
  • cleanups based on Go Report Card
    feedback

v1.16.0

02 May 15:50
Compare
Choose a tag to compare

Added

  • Hidden field on all flag struct types to omit from generated help text

Changed

  • BashCompletionFlag (--enable-bash-completion) is now omitted from
    generated help text via the Hidden field

Fixed

  • handling of error values in HandleAction and HandleExitCoder

v1.15.0

30 Apr 17:58
Compare
Choose a tag to compare

Added

  • A CHANGELOG.md file!
  • Support for placeholders in flag usage strings
  • App.Metadata map for arbitrary data/state management
  • Set and GlobalSet methods on *cli.Context for altering values after
    parsing.
  • Support for nested lookup of dot-delimited keys in structures loaded from
    YAML.

Changed

  • The App.Action and Command.Action now prefer a return signature of
    func(*cli.Context) error, as defined by cli.ActionFunc. If a non-nil
    error is returned, there may be two outcomes:
    • If the error fulfills cli.ExitCoder, then os.Exit will be called
      automatically
    • Else the error is bubbled up and returned from App.Run
  • Specifying an Action with the legacy return signature of
    func(*cli.Context) will produce a deprecation message to stderr
  • Specifying an Action that is not a func type will produce a non-zero exit
    from App.Run
  • Specifying an Action func that has an invalid (input) signature will
    produce a non-zero exit from App.Run

Deprecated


  • cli.App.RunAndExitOnError, which should now be done by returning an error
    that fulfills cli.ExitCoder to cli.App.Run.
  • the legacy signature for
    cli.App.Action of func(*cli.Context), which should now have a return
    signature of func(*cli.Context) error, as defined by cli.ActionFunc.

Fixed

  • Added missing *cli.Context.GlobalFloat64 method