urfave/cli v2.0.0 Release Notes

Release Date: 2019-11-21 // over 4 years ago
  • ๐Ÿ”€ 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 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