Skip to content

Releases: urfave/cli

Release 2.0.0

21 Nov 09:07
754ed1b

Choose a tag to compare

V2 was merged in #892, which included the work of all of these contributors: @asahasrabuddhe, @meatballhat, @jszwedko, @lynncyrin, @AudriusButkevicius, @saschagrunert, @rliebz, @johnweldon, @nlewo, @grubernaut, @OneOfOne, @VMitov, @cbranch, @marwan-at-work, @uudashr, @bfreis

Discuss the state of V2 here => #826


Added

  • Added NewStringSlice and NewIntSlice for creating their related types
  • Added Float64SliceFlag for unmarshaling a list of floats from the user
  • Added Context.Lineage to get all contexts from current up to global
  • Added Context.LocalFlagNames to get the flag names from only the current context
  • Added BoolFlag.Value to handle both default-false and default-true
  • Added IsSet method to the Flag interface which allows us to detect whether or not a flag has been set

Changed

  • Occurrences of []Command have been changed to []*Command
  • Occurrences of []cli.Flag have been changed to []*cli.Flag
  • Context.FlagNames now returns all flags in the context lineage
  • Context.IsSet now considers the full context lineage

Removed

  • Removed Global* flags since all flags are now global
    • when updating, replace GlobalBool with Bool
    • and GlobalInt with Int
    • and GlobalString with String
    • and so on for any other global flags
  • Removed Context.Parent method, as this is now available via Context.Lineage
    • when updating, replace Context.Parent() with Context.Lineage()[1]
  • Removed the App.Author and App.Email
    • these have been replaced with the Authors []*Author field
  • Removed the ability to specify multiple entries in the Command.Name field
    • when updating, replace Name: "a, b, c" with Name: "a", Aliases: []string{"b", "c"}
  • Removed the Command.ShortName field
    • when updating, replace ShortName: "i" with Aliases: []string{"i"}
  • Removed all Context.Global* methods, as the non-global versions now traverse up
    the context lineage automatically.
  • Removed the ability to specify &StringSlice{...string} or &IntSlice{...int}.
  • Removed adapter code for deprecated Action func signature
  • Removed BoolTFlag and related code, as this is now available via BoolFlag.Value

Release 1.22.2

21 Nov 09:03
850de85

Choose a tag to compare

Fixed

Changed

Release 2.0.0 Alpha 2

15 Sep 09:38
d870ad6

Choose a tag to compare

Release 2.0.0 Alpha 2 Pre-release
Pre-release

This is a pre-release meant for internal testing purposes. Please do not use this until you really know what you are doing.

Release 2.0.0 Alpha

13 Sep 00:15
c75fee9

Choose a tag to compare

Release 2.0.0 Alpha Pre-release
Pre-release

This is a pre-release meant for internal testing purposes. Please do not use this until you really know what you are doing.

Release 1.22.1

12 Sep 00:07
c71fbce

Choose a tag to compare

🚧 Watch out! There's a known regression in this release! #850 🚧

Fixed

Changed

Release 1.22.0

10 Sep 00:59
bfe2e92

Choose a tag to compare

🚧 Watch out! There's a known regression in this release! #850 🚧

Fixed

Changed

Added

Release 1.21.0

04 Aug 02:42
e6cf83e

Choose a tag to compare

🚧 Watch out! There's a known regression in this release! #850 🚧

Fixed

Added / Changed

cli v1.19.1

22 Nov 04:37

Choose a tag to compare

Fixed

  • Fixes regression introduced in 1.19.0 where using an ActionFunc as
    the Action for a command would cause it to error rather than calling the
    function. Should not have a affected declarative cases using func(c *cli.Context) err).
  • Shell completion now handles the case where the user specifies
    --generate-bash-completion immediately after a flag that takes an argument.
    Previously it call the application with --generate-bash-completion as the
    flag value.

cli v1.19.0

19 Nov 19:04

Choose a tag to compare

Added

  • FlagsByName was added to make it easy to sort flags (e.g. sort.Sort(cli.FlagsByName(app.Flags)))
  • A Description field was added to App for a more detailed description of
    the application (similar to the existing Description field on Command)
  • Flag type code generation via go generate
  • Write to stderr and exit 1 if action returns non-nil error
  • Added support for TOML to the altsrc loader
  • SkipArgReorder was added to allow users to skip the argument reordering.
    This is useful if you want to consider all "flags" after an argument as
    arguments rather than flags (the default behavior of the stdlib flag
    library). This is backported functionality from the removal of the flag
    reordering
    in the unreleased version
    2
  • For formatted errors (those implementing ErrorFormatter), the errors will
    be formatted during output. Compatible with pkg/errors.

Changed

  • Raise minimum tested/supported Go version to 1.2+

Fixed

  • Consider empty environment variables as set (previously environment variables
    with the equivalent of "" would be skipped rather than their value used).
  • Return an error if the value in a given environment variable cannot be parsed
    as the flag type. Previously these errors were silently swallowed.
  • Print full error when an invalid flag is specified (which includes the invalid flag)
  • App.Writer defaults to stdout when nil
  • If no action is specified on a command or app, the help is now printed instead of panicing
  • App.Metadata is initialized automatically now (previously was nil unless initialized)
  • Correctly show help message if -h is provided to a subcommand
  • context.(Global)IsSet now respects environment variables. Previously it
    would return false if a flag was specified in the environment rather than
    as an argument
  • Removed deprecation warnings to STDERR to avoid them leaking to the end-user
  • altsrcs import paths were updated to use gopkg.in/urfave/cli.v1. This
    fixes issues that occurred when gopkg.in/urfave/cli.v1 was imported as well
    as altsrc where Go would complain that the types didn't match

cli v1.18.1

29 Aug 00:53

Choose a tag to compare

Fixed

  • Removed deprecation warnings to STDERR to avoid them leaking to the end-user (backported)