From 7a8e19eb62ac33a4587a7cfc3c15006decc8976a Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 30 Apr 2024 20:27:35 +0100 Subject: [PATCH 1/5] update GitHub Actions (bump versions, improve naming a bit) --- .github/workflows/golangci-lint.yml | 25 ---------------- .github/workflows/lint.yml | 38 +++++++++++++++++++++++++ .github/workflows/{cli.yml => test.yml} | 34 ++++++++++++++++------ 3 files changed, 64 insertions(+), 33 deletions(-) delete mode 100644 .github/workflows/golangci-lint.yml create mode 100644 .github/workflows/lint.yml rename .github/workflows/{cli.yml => test.yml} (85%) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml deleted file mode 100644 index 5de3ee0a66..0000000000 --- a/.github/workflows/golangci-lint.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: golangci-lint -on: - push: - tags: - - v3.* - branches: - - main - pull_request: - branches: - - main -permissions: - contents: read -jobs: - golangci: - name: lint - runs-on: ubuntu-latest - steps: - - uses: actions/setup-go@v3 - with: - go-version: "1.20" - - uses: actions/checkout@v3 - - name: golangci-lint - uses: golangci/golangci-lint-action@v3 - with: - version: latest \ No newline at end of file diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..df5d9f659a --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,38 @@ +name: Run lints + +on: + push: + tags: + - v3.* + branches: + - main + pull_request: + branches: + - main + +permissions: + contents: read + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.20" + + - name: Clone repository + uses: actions/checkout@v4 + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v5 + with: + version: latest + + - name: Set up staticcheck + run: go install honnef.co/go/tools/cmd/staticcheck@latest + + - name: Run staticcheck + run: staticcheck ./... diff --git a/.github/workflows/cli.yml b/.github/workflows/test.yml similarity index 85% rename from .github/workflows/cli.yml rename to .github/workflows/test.yml index a2a7df6a5d..e7ed5e6ec1 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,5 @@ -name: Run Tests +name: Run tests + on: push: branches: @@ -8,20 +9,26 @@ on: pull_request: branches: - main + permissions: contents: read + jobs: test: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] go: [1.19.x, 1.20.x] + name: ${{ matrix.os }} @ Go ${{ matrix.go }} runs-on: ${{ matrix.os }} + steps: - - uses: actions/setup-go@v3 + - name: Set up Go + uses: actions/setup-go@v5 with: go-version: ${{ matrix.go }} + - name: Set PATH run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}" - uses: actions/checkout@v3 @@ -47,38 +54,49 @@ jobs: name: test-docs runs-on: ubuntu-latest steps: - - uses: actions/setup-go@v3 + - name: Set up Go + uses: actions/setup-go@v5 with: go-version: 1.20.x - - uses: actions/setup-node@v3 + + - name: Set up Node.js + uses: actions/setup-node@v4 with: - node-version: '16' + node-version: 16 + - name: Set PATH run: echo "${GITHUB_WORKSPACE}/.local/bin" >>"${GITHUB_PATH}" - - uses: actions/checkout@v3 + + - name: Clone repository + uses: actions/checkout@v4 + - run: make ensure-gfmrun - run: make gfmrun env: FLAGS: --walk docs/v3/ - run: make diffcheck + publish: permissions: contents: write # TODO: switch once v3 is out of alpha {{ # if: startswith(github.ref, 'refs/tags/') - if: 'false' + if: false # }} name: publish needs: [test-docs] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 + - run: make ensure-mkdocs env: FLAGS: --upgrade-pip + - run: make set-mkdocs-remote env: MKDOCS_REMOTE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: make deploy-mkdocs From 08cc50ba6c7e9d264393573db143f0393e58d318 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 30 Apr 2024 20:31:19 +0100 Subject: [PATCH 2/5] enable all staticcheck lints --- staticcheck.conf | 1 + 1 file changed, 1 insertion(+) create mode 100644 staticcheck.conf diff --git a/staticcheck.conf b/staticcheck.conf new file mode 100644 index 0000000000..233d9e73a8 --- /dev/null +++ b/staticcheck.conf @@ -0,0 +1 @@ +checks=["all"] From f63cacb0a0b9ec969dd3455e22067ad85894995f Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 30 Apr 2024 20:48:40 +0100 Subject: [PATCH 3/5] resolve all staticcheck warnings --- command.go | 19 +++++----- flag_bool.go | 6 +-- flag_bool_with_inverse.go | 78 +++++++++++++++++++-------------------- flag_duration.go | 6 +-- flag_float.go | 2 +- flag_impl.go | 2 +- flag_int.go | 2 +- flag_string.go | 10 ++--- flag_timestamp.go | 6 ++- help.go | 2 +- 10 files changed, 66 insertions(+), 67 deletions(-) diff --git a/command.go b/command.go index d871365ff9..3f79857280 100644 --- a/command.go +++ b/command.go @@ -359,11 +359,11 @@ func (cmd *Command) ensureHelp() { func (cmd *Command) parseArgsFromStdin() ([]string, error) { type state int const ( - STATE_SEARCH_FOR_TOKEN state = -1 - STATE_IN_STRING state = 0 + stateSearchForToken state = -1 + stateSearchForString state = 0 ) - st := STATE_SEARCH_FOR_TOKEN + st := stateSearchForToken linenum := 1 token := "" args := []string{} @@ -375,11 +375,11 @@ outer: ch, _, err := breader.ReadRune() if err == io.EOF { switch st { - case STATE_SEARCH_FOR_TOKEN: + case stateSearchForToken: if token != "--" { args = append(args, token) } - case STATE_IN_STRING: + case stateSearchForString: // make sure string is not empty for _, t := range token { if !unicode.IsSpace(t) { @@ -393,7 +393,7 @@ outer: return nil, err } switch st { - case STATE_SEARCH_FOR_TOKEN: + case stateSearchForToken: if unicode.IsSpace(ch) || ch == '"' { if ch == '\n' { linenum++ @@ -407,12 +407,12 @@ outer: token = "" } if ch == '"' { - st = STATE_IN_STRING + st = stateSearchForString } continue } token += string(ch) - case STATE_IN_STRING: + case stateSearchForString: if ch != '"' { token += string(ch) } else { @@ -423,7 +423,7 @@ outer: /*else { //TODO. Should we pass in empty strings ? }*/ - st = STATE_SEARCH_FOR_TOKEN + st = stateSearchForToken } } } @@ -1181,7 +1181,6 @@ func hasCommand(commands []*Command, command *Command) bool { } func (cmd *Command) runFlagActions(ctx context.Context) error { - for _, fl := range cmd.appliedFlags { isSet := false diff --git a/flag_bool.go b/flag_bool.go index fd7f8c476c..4ad81d58b8 100644 --- a/flag_bool.go +++ b/flag_bool.go @@ -37,7 +37,7 @@ func (cmd *Command) Bool(name string) bool { // Below functions are to satisfy the ValueCreator interface // Create creates the bool value -func (i boolValue) Create(val bool, p *bool, c BoolConfig) Value { +func (b boolValue) Create(val bool, p *bool, c BoolConfig) Value { *p = val if c.Count == nil { c.Count = new(int) @@ -49,8 +49,8 @@ func (i boolValue) Create(val bool, p *bool, c BoolConfig) Value { } // ToString formats the bool value -func (i boolValue) ToString(b bool) string { - return strconv.FormatBool(b) +func (b boolValue) ToString(value bool) string { + return strconv.FormatBool(value) } // Below functions are to satisfy the flag.Value interface diff --git a/flag_bool_with_inverse.go b/flag_bool_with_inverse.go index 0e256b3e8d..a7fea1ba92 100644 --- a/flag_bool_with_inverse.go +++ b/flag_bool_with_inverse.go @@ -7,9 +7,7 @@ import ( "strings" ) -var ( - DefaultInverseBoolPrefix = "no-" -) +var DefaultInverseBoolPrefix = "no-" type BoolWithInverseFlag struct { // The BoolFlag which the positive and negative flags are generated from @@ -29,44 +27,42 @@ type BoolWithInverseFlag struct { negDest *bool } -func (s *BoolWithInverseFlag) Flags() []Flag { - return []Flag{s.positiveFlag, s.negativeFlag} +func (parent *BoolWithInverseFlag) Flags() []Flag { + return []Flag{parent.positiveFlag, parent.negativeFlag} } -func (s *BoolWithInverseFlag) IsSet() bool { - return (*s.posCount > 0) || (s.positiveFlag.IsSet() || s.negativeFlag.IsSet()) +func (parent *BoolWithInverseFlag) IsSet() bool { + return (*parent.posCount > 0) || (parent.positiveFlag.IsSet() || parent.negativeFlag.IsSet()) } -func (s *BoolWithInverseFlag) Value() bool { - return *s.posDest +func (parent *BoolWithInverseFlag) Value() bool { + return *parent.posDest } -func (s *BoolWithInverseFlag) RunAction(ctx context.Context, cmd *Command) error { - if *s.negDest && *s.posDest { - return fmt.Errorf("cannot set both flags `--%s` and `--%s`", s.positiveFlag.Name, s.negativeFlag.Name) +func (parent *BoolWithInverseFlag) RunAction(ctx context.Context, cmd *Command) error { + if *parent.negDest && *parent.posDest { + return fmt.Errorf("cannot set both flags `--%s` and `--%s`", parent.positiveFlag.Name, parent.negativeFlag.Name) } - if *s.negDest { - err := cmd.Set(s.positiveFlag.Name, "false") + if *parent.negDest { + err := cmd.Set(parent.positiveFlag.Name, "false") if err != nil { return err } } - if s.BoolFlag.Action != nil { - return s.BoolFlag.Action(ctx, cmd, s.Value()) + if parent.BoolFlag.Action != nil { + return parent.BoolFlag.Action(ctx, cmd, parent.Value()) } return nil } -/* -initialize creates a new BoolFlag that has an inverse flag - -consider a bool flag `--env`, there is no way to set it to false -this function allows you to set `--env` or `--no-env` and in the command action -it can be determined that BoolWithInverseFlag.IsSet() -*/ +// Initialize creates a new BoolFlag that has an inverse flag +// +// consider a bool flag `--env`, there is no way to set it to false +// this function allows you to set `--env` or `--no-env` and in the command action +// it can be determined that BoolWithInverseFlag.IsSet(). func (parent *BoolWithInverseFlag) initialize() { child := parent.BoolFlag @@ -138,45 +134,47 @@ func (parent *BoolWithInverseFlag) inverseAliases() (aliases []string) { return } -func (s *BoolWithInverseFlag) Apply(set *flag.FlagSet) error { - if s.positiveFlag == nil { - s.initialize() +func (parent *BoolWithInverseFlag) Apply(set *flag.FlagSet) error { + if parent.positiveFlag == nil { + parent.initialize() } - if err := s.positiveFlag.Apply(set); err != nil { + if err := parent.positiveFlag.Apply(set); err != nil { return err } - if err := s.negativeFlag.Apply(set); err != nil { + if err := parent.negativeFlag.Apply(set); err != nil { return err } return nil } -func (s *BoolWithInverseFlag) Names() []string { +func (parent *BoolWithInverseFlag) Names() []string { // Get Names when flag has not been initialized - if s.positiveFlag == nil { - return append(s.BoolFlag.Names(), FlagNames(s.inverseName(), s.inverseAliases())...) + if parent.positiveFlag == nil { + return append(parent.BoolFlag.Names(), FlagNames(parent.inverseName(), parent.inverseAliases())...) } - if *s.negDest { - return s.negativeFlag.Names() + if *parent.negDest { + return parent.negativeFlag.Names() } - if *s.posDest { - return s.positiveFlag.Names() + if *parent.posDest { + return parent.positiveFlag.Names() } - return append(s.negativeFlag.Names(), s.positiveFlag.Names()...) + return append(parent.negativeFlag.Names(), parent.positiveFlag.Names()...) } +// String implements the standard Stringer interface. +// // Example for BoolFlag{Name: "env"} // --env (default: false) || --no-env (default: false) -func (s *BoolWithInverseFlag) String() string { - if s.positiveFlag == nil { - return fmt.Sprintf("%s || --%s", s.BoolFlag.String(), s.inverseName()) +func (parent *BoolWithInverseFlag) String() string { + if parent.positiveFlag == nil { + return fmt.Sprintf("%s || --%s", parent.BoolFlag.String(), parent.inverseName()) } - return fmt.Sprintf("%s || %s", s.positiveFlag.String(), s.negativeFlag.String()) + return fmt.Sprintf("%s || %s", parent.positiveFlag.String(), parent.negativeFlag.String()) } diff --git a/flag_duration.go b/flag_duration.go index 2a79458c28..37b4cb642f 100644 --- a/flag_duration.go +++ b/flag_duration.go @@ -12,13 +12,13 @@ type durationValue time.Duration // Below functions are to satisfy the ValueCreator interface -func (i durationValue) Create(val time.Duration, p *time.Duration, c NoConfig) Value { +func (d durationValue) Create(val time.Duration, p *time.Duration, c NoConfig) Value { *p = val return (*durationValue)(p) } -func (i durationValue) ToString(d time.Duration) string { - return fmt.Sprintf("%v", d) +func (d durationValue) ToString(val time.Duration) string { + return fmt.Sprintf("%v", val) } // Below functions are to satisfy the flag.Value interface diff --git a/flag_float.go b/flag_float.go index 058440fccc..406b55b64d 100644 --- a/flag_float.go +++ b/flag_float.go @@ -35,7 +35,7 @@ func (f *floatValue) Get() any { return float64(*f) } func (f *floatValue) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) } -// Int looks up the value of a local IntFlag, returns +// Float looks up the value of a local FloatFlag, returns // 0 if not found func (cmd *Command) Float(name string) float64 { if v, ok := cmd.Value(name).(float64); ok { diff --git a/flag_impl.go b/flag_impl.go index 3e9fdbc901..36edcc903b 100644 --- a/flag_impl.go +++ b/flag_impl.go @@ -61,7 +61,7 @@ type ValueCreator[T any, C any] interface { // NoConfig is for flags which dont need a custom configuration type NoConfig struct{} -// FlagBase[T,C,VC] is a generic flag base which can be used +// FlagBase [T,C,VC] is a generic flag base which can be used // as a boilerplate to implement the most common interfaces // used by urfave/cli. // diff --git a/flag_int.go b/flag_int.go index 4403dae0f2..f8e3640b1a 100644 --- a/flag_int.go +++ b/flag_int.go @@ -46,7 +46,7 @@ func (i *intValue) Get() any { return int64(*i.val) } func (i *intValue) String() string { return strconv.FormatInt(int64(*i.val), 10) } -// Int64 looks up the value of a local Int64Flag, returns +// Int looks up the value of a local Int64Flag, returns // 0 if not found func (cmd *Command) Int(name string) int64 { if v, ok := cmd.Value(name).(int64); ok { diff --git a/flag_string.go b/flag_string.go index c56c99b5af..bdc1ec65fc 100644 --- a/flag_string.go +++ b/flag_string.go @@ -21,7 +21,7 @@ type stringValue struct { // Below functions are to satisfy the ValueCreator interface -func (i stringValue) Create(val string, p *string, c StringConfig) Value { +func (s stringValue) Create(val string, p *string, c StringConfig) Value { *p = val return &stringValue{ destination: p, @@ -29,11 +29,11 @@ func (i stringValue) Create(val string, p *string, c StringConfig) Value { } } -func (i stringValue) ToString(b string) string { - if b == "" { - return b +func (s stringValue) ToString(val string) string { + if val == "" { + return val } - return fmt.Sprintf("%q", b) + return fmt.Sprintf("%q", val) } // Below functions are to satisfy the flag.Value interface diff --git a/flag_timestamp.go b/flag_timestamp.go index 3709bd83e8..d008080c1a 100644 --- a/flag_timestamp.go +++ b/flag_timestamp.go @@ -21,9 +21,11 @@ type timestampValue struct { location *time.Location } +var _ ValueCreator[time.Time, TimestampConfig] = timestampValue{} + // Below functions are to satisfy the ValueCreator interface -func (i timestampValue) Create(val time.Time, p *time.Time, c TimestampConfig) Value { +func (t timestampValue) Create(val time.Time, p *time.Time, c TimestampConfig) Value { *p = val return ×tampValue{ timestamp: p, @@ -32,7 +34,7 @@ func (i timestampValue) Create(val time.Time, p *time.Time, c TimestampConfig) V } } -func (i timestampValue) ToString(b time.Time) string { +func (t timestampValue) ToString(b time.Time) string { if b.IsZero() { return "" } diff --git a/help.go b/help.go index d4a056adc6..411d0ca42c 100644 --- a/help.go +++ b/help.go @@ -562,7 +562,7 @@ func offset(input string, fixed int) int { // to find that offset we find the length of all the rows and use the max // to calculate the offset func offsetCommands(cmds []*Command, fixed int) int { - var max int = 0 + max := 0 for _, cmd := range cmds { s := strings.Join(cmd.Names(), ", ") if len(s) > max { From 17e5dee4ee0ca52120153ca129812a46c5d5cc8f Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 30 Apr 2024 20:49:52 +0100 Subject: [PATCH 4/5] split linting into separate jobs for golangci-lint and staticcheck --- .github/workflows/lint.yml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index df5d9f659a..4c53fde370 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,9 +14,8 @@ permissions: contents: read jobs: - lint: + staticcheck: runs-on: ubuntu-latest - steps: - name: Set up Go uses: actions/setup-go@v5 @@ -26,13 +25,25 @@ jobs: - name: Clone repository uses: actions/checkout@v4 - - name: Run golangci-lint - uses: golangci/golangci-lint-action@v5 - with: - version: latest - - name: Set up staticcheck run: go install honnef.co/go/tools/cmd/staticcheck@latest - name: Run staticcheck run: staticcheck ./... + + golangci-lint: + runs-on: ubuntu-latest + + steps: + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: "1.20" + + - name: Clone repository + uses: actions/checkout@v4 + + - name: Run golangci-lint + uses: golangci/golangci-lint-action@v5 + with: + version: latest From 2df7fe4ca19c487fe16e1fcc4eab1112f2bd9376 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Wed, 1 May 2024 01:52:42 +0100 Subject: [PATCH 5/5] update godoc-current --- godoc-current.txt | 26 +++++++++++++------------- testdata/godoc-v3.x.txt | 26 +++++++++++++------------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/godoc-current.txt b/godoc-current.txt index b3d0e9e42c..80a1a5fa77 100644 --- a/godoc-current.txt +++ b/godoc-current.txt @@ -51,9 +51,7 @@ OPTIONS:{{template "visibleFlagTemplate" .}}{{end}} uses text/template to render templates. You can render custom help text by setting this variable. -var ( - DefaultInverseBoolPrefix = "no-" -) +var DefaultInverseBoolPrefix = "no-" var ErrWriter io.Writer = os.Stderr ErrWriter is used to write errors to the user. This can be anything implementing the io.Writer interface and defaults to os.Stderr. @@ -270,21 +268,23 @@ type BoolWithInverseFlag struct { // Has unexported fields. } -func (s *BoolWithInverseFlag) Apply(set *flag.FlagSet) error +func (parent *BoolWithInverseFlag) Apply(set *flag.FlagSet) error + +func (parent *BoolWithInverseFlag) Flags() []Flag -func (s *BoolWithInverseFlag) Flags() []Flag +func (parent *BoolWithInverseFlag) IsSet() bool -func (s *BoolWithInverseFlag) IsSet() bool +func (parent *BoolWithInverseFlag) Names() []string -func (s *BoolWithInverseFlag) Names() []string +func (parent *BoolWithInverseFlag) RunAction(ctx context.Context, cmd *Command) error -func (s *BoolWithInverseFlag) RunAction(ctx context.Context, cmd *Command) error +func (parent *BoolWithInverseFlag) String() string + String implements the standard Stringer interface. -func (s *BoolWithInverseFlag) String() string Example for BoolFlag{Name: "env"} --env (default: false) || --no-env (default: false) -func (s *BoolWithInverseFlag) Value() bool +func (parent *BoolWithInverseFlag) Value() bool type CategorizableFlag interface { // Returns the category of the flag @@ -425,7 +425,7 @@ func (cmd *Command) FlagNames() []string its parent commands. func (cmd *Command) Float(name string) float64 - Int looks up the value of a local IntFlag, returns 0 if not found + Float looks up the value of a local FloatFlag, returns 0 if not found func (cmd *Command) FloatSlice(name string) []float64 FloatSlice looks up the value of a local FloatSliceFlag, returns nil if not @@ -439,7 +439,7 @@ func (cmd *Command) HasName(name string) bool HasName returns true if Command.Name matches given name func (cmd *Command) Int(name string) int64 - Int64 looks up the value of a local Int64Flag, returns 0 if not found + Int looks up the value of a local Int64Flag, returns 0 if not found func (cmd *Command) IntSlice(name string) []int64 IntSlice looks up the value of a local IntSliceFlag, returns nil if not @@ -655,7 +655,7 @@ type FlagBase[T any, C any, VC ValueCreator[T, C]] struct { // Has unexported fields. } - FlagBase[T,C,VC] is a generic flag base which can be used as a boilerplate + FlagBase [T,C,VC] is a generic flag base which can be used as a boilerplate to implement the most common interfaces used by urfave/cli. T specifies the type diff --git a/testdata/godoc-v3.x.txt b/testdata/godoc-v3.x.txt index b3d0e9e42c..80a1a5fa77 100644 --- a/testdata/godoc-v3.x.txt +++ b/testdata/godoc-v3.x.txt @@ -51,9 +51,7 @@ OPTIONS:{{template "visibleFlagTemplate" .}}{{end}} uses text/template to render templates. You can render custom help text by setting this variable. -var ( - DefaultInverseBoolPrefix = "no-" -) +var DefaultInverseBoolPrefix = "no-" var ErrWriter io.Writer = os.Stderr ErrWriter is used to write errors to the user. This can be anything implementing the io.Writer interface and defaults to os.Stderr. @@ -270,21 +268,23 @@ type BoolWithInverseFlag struct { // Has unexported fields. } -func (s *BoolWithInverseFlag) Apply(set *flag.FlagSet) error +func (parent *BoolWithInverseFlag) Apply(set *flag.FlagSet) error + +func (parent *BoolWithInverseFlag) Flags() []Flag -func (s *BoolWithInverseFlag) Flags() []Flag +func (parent *BoolWithInverseFlag) IsSet() bool -func (s *BoolWithInverseFlag) IsSet() bool +func (parent *BoolWithInverseFlag) Names() []string -func (s *BoolWithInverseFlag) Names() []string +func (parent *BoolWithInverseFlag) RunAction(ctx context.Context, cmd *Command) error -func (s *BoolWithInverseFlag) RunAction(ctx context.Context, cmd *Command) error +func (parent *BoolWithInverseFlag) String() string + String implements the standard Stringer interface. -func (s *BoolWithInverseFlag) String() string Example for BoolFlag{Name: "env"} --env (default: false) || --no-env (default: false) -func (s *BoolWithInverseFlag) Value() bool +func (parent *BoolWithInverseFlag) Value() bool type CategorizableFlag interface { // Returns the category of the flag @@ -425,7 +425,7 @@ func (cmd *Command) FlagNames() []string its parent commands. func (cmd *Command) Float(name string) float64 - Int looks up the value of a local IntFlag, returns 0 if not found + Float looks up the value of a local FloatFlag, returns 0 if not found func (cmd *Command) FloatSlice(name string) []float64 FloatSlice looks up the value of a local FloatSliceFlag, returns nil if not @@ -439,7 +439,7 @@ func (cmd *Command) HasName(name string) bool HasName returns true if Command.Name matches given name func (cmd *Command) Int(name string) int64 - Int64 looks up the value of a local Int64Flag, returns 0 if not found + Int looks up the value of a local Int64Flag, returns 0 if not found func (cmd *Command) IntSlice(name string) []int64 IntSlice looks up the value of a local IntSliceFlag, returns nil if not @@ -655,7 +655,7 @@ type FlagBase[T any, C any, VC ValueCreator[T, C]] struct { // Has unexported fields. } - FlagBase[T,C,VC] is a generic flag base which can be used as a boilerplate + FlagBase [T,C,VC] is a generic flag base which can be used as a boilerplate to implement the most common interfaces used by urfave/cli. T specifies the type