From 92267aec5040543328698a20a1bbbd03626b5212 Mon Sep 17 00:00:00 2001 From: Celestino Amoroso Date: Fri, 6 Mar 2026 06:32:17 +0100 Subject: [PATCH] cli.go: in CliParser.Parse() renamed args as commandArgs --- cli.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cli.go b/cli.go index ea1268d..b195eab 100644 --- a/cli.go +++ b/cli.go @@ -161,7 +161,7 @@ func (cli *CliParser) addHelpAndVersion() { func (cli *CliParser) Parse() (err error) { var arg string var i int - var args []string + var commandArgs []string var optionsAllowed bool = true cli.addHelpAndVersion() @@ -182,7 +182,7 @@ func (cli *CliParser) Parse() (err error) { break } } else { - args = append(args, arg) + commandArgs = append(commandArgs, arg) } } } @@ -196,18 +196,18 @@ func (cli *CliParser) Parse() (err error) { specIndex := -1 for index, argSpec := range cli.argSpecs { specIndex = index - if n, err = argSpec.parse(cli, specIndex, args, i); err != nil { + if n, err = argSpec.parse(cli, specIndex, commandArgs, i); err != nil { break } i += n - if i >= len(args) { + if i >= len(commandArgs) { break } } // check if there are remaining arg-specs that require a value if err == nil { - if i < len(args) { + if i < len(commandArgs) { err = fmt.Errorf("too many arguments: %d allowed", i) } else { specIndex++