@@ -456,12 +456,10 @@ func GetCommands() []cli.Command {
456456// so we can capture user-provided flags consistently in one place for all build commands.
457457func decorateWithFlagCapture (cmds []cli.Command ) []cli.Command {
458458 for i := range cmds {
459- name := cmds [i ].Name
460- aliases := append ([]string (nil ), cmds [i ].Aliases ... )
461459 skipFlagParsing := cmds [i ].SkipFlagParsing
462460 origBefore := cmds [i ].Before
463461 cmds [i ].Before = func (c * cli.Context ) error {
464- captureUserFlagsForMetrics (c , name , aliases , skipFlagParsing )
462+ captureUserFlagsForMetrics (c , skipFlagParsing )
465463 if origBefore != nil {
466464 return origBefore (c )
467465 }
@@ -473,7 +471,7 @@ func decorateWithFlagCapture(cmds []cli.Command) []cli.Command {
473471
474472// captureUserFlagsForMetrics extracts flag names as provided by the end-user for the given command
475473// and records them for usage metrics. Works even when SkipFlagParsing is true by scanning os.Args.
476- func captureUserFlagsForMetrics (c * cli.Context , cmdName string , aliases [] string , skipFlagParsing bool ) {
474+ func captureUserFlagsForMetrics (c * cli.Context , skipFlagParsing bool ) {
477475 flagSet := map [string ]struct {}{}
478476
479477 if ! skipFlagParsing {
@@ -513,15 +511,6 @@ func captureUserFlagsForMetrics(c *cli.Context, cmdName string, aliases []string
513511 commands .SetContextFlags (flags )
514512}
515513
516- func containsString (list []string , target string ) bool {
517- for _ , s := range list {
518- if s == target {
519- return true
520- }
521- }
522- return false
523- }
524-
525514func MvnCmd (c * cli.Context ) (err error ) {
526515 if show , err := cliutils .ShowCmdHelpIfNeeded (c , c .Args ()); show || err != nil {
527516 return err
0 commit comments