urfave/cli v2.0.0 Release Notes

Release Date: 2019-11-21 // over 2 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