Changelog History
Page 1
-
v1.7.0 Changes
May 09, 2024What's Changed
- feat: Call a given function after calling the command (PostRun) by @GreyXor in #21
➕ add slice flags by @zkep in #23
Example:StringsDefault[]string`name:"strings_default"description:"Thestringsdefault"default:"one|two|three"sep:"|"
🆕 New Contributors
Full Changelog : v1.6.0...v1.7.0
-
v1.6.0 Changes
January 23, 2023👌 Support positional arguments using the
posstruct tag:typePosPersonstruct{Namestring
description:"The name of the person" pos:"1"Adminbooldescription:"Is the person an admin" pos:"2"}funcTestCli_PositionalArgs(t*testing.T) {c:=NewCli("test","test positional args","0")c.NewSubCommandFunction("create","create a person",func(person*PosPerson)error{ifperson.Name!="bob"{t.Errorf("expected 'bob', got '%v'",person.Name) }ifperson.Admin!=true{t.Errorf("expected true, got %v",person.Admin) }returnnil})e:=c.Run("create","bob","true")ife!=nil{t.Errorf("unexpected error") } }
-
v1.5.0 Changes
January 18, 2023- ➕ Add
defaultstruct tag so you can define default values for cli flags. See https://clir.leaanthony.com/guide/subcommands/#adding-subcommands-with-functions
- ➕ Add
-
v1.4.0 Changes
December 19, 2022- 👌 Support Int64, Uint, Uint64, Float64
-
v1.3.0 Changes
November 22, 2022- 👌 Support flags in embedded structs
-
v1.2.1 Changes
November 21, 2022- 🛠 Fix crash in
AddFlagsif input has unexported fields
- 🛠 Fix crash in
-
v1.2.0 Changes
October 29, 2022- 🆕 New method to rapidly add sub commands:
NewSubCommandFunction. Bind a function to a subcommand name and the function input gets automatically converted to CLI flags in the same wayAddFlagsworks. The method is automatically called with the CLI flags. Specify default flags using an optionalDefault()method on your flags struct: https://clir.leaanthony.com/guide/subcommands/#adding-subcommands-with-functions
- 🆕 New method to rapidly add sub commands:
-
v1.1.0 Changes
October 27, 2022- 🆕 New
AddFlagscommand to add flags using a struct. Details here: https://clir.leaanthony.com/guide/flags/#defining-flags-using-a-struct
- 🆕 New
-
v1.0.6 Changes
September 08, 2022What's Changed
- 🔋 Feature: subcommands flags inherence by @thetechpanda in #18
🆕 New Contributors
- @thetechpanda made their first contribution in #18
Full Changelog : v1.0.5...v1.0.6
-
v1.0.5 Changes
October 11, 2021- 👍 Better errors - Thanks @bh90210