@@ -455,12 +455,10 @@ func GetCommands() []cli.Command {
455455// so we can capture user-provided flags consistently in one place for all build commands.
456456func decorateWithFlagCapture (cmds []cli.Command ) []cli.Command {
457457 for i := range cmds {
458- name := cmds [i ].Name
459- aliases := append ([]string (nil ), cmds [i ].Aliases ... )
460458 skipFlagParsing := cmds [i ].SkipFlagParsing
461459 origBefore := cmds [i ].Before
462460 cmds [i ].Before = func (c * cli.Context ) error {
463- captureUserFlagsForMetrics (c , name , aliases , skipFlagParsing )
461+ captureUserFlagsForMetrics (c , skipFlagParsing )
464462 if origBefore != nil {
465463 return origBefore (c )
466464 }
@@ -472,7 +470,7 @@ func decorateWithFlagCapture(cmds []cli.Command) []cli.Command {
472470
473471// captureUserFlagsForMetrics extracts flag names as provided by the end-user for the given command
474472// and records them for usage metrics. Works even when SkipFlagParsing is true by scanning os.Args.
475- func captureUserFlagsForMetrics (c * cli.Context , cmdName string , aliases [] string , skipFlagParsing bool ) {
473+ func captureUserFlagsForMetrics (c * cli.Context , skipFlagParsing bool ) {
476474 flagSet := map [string ]struct {}{}
477475
478476 if ! skipFlagParsing {
@@ -512,15 +510,6 @@ func captureUserFlagsForMetrics(c *cli.Context, cmdName string, aliases []string
512510 commands .SetContextFlags (flags )
513511}
514512
515- func containsString (list []string , target string ) bool {
516- for _ , s := range list {
517- if s == target {
518- return true
519- }
520- }
521- return false
522- }
523-
524513func MvnCmd (c * cli.Context ) (err error ) {
525514 if show , err := cliutils .ShowCmdHelpIfNeeded (c , c .Args ()); show || err != nil {
526515 return err
0 commit comments