From 99d0be84dffa23cb5b2814a123afebb476b23ee2 Mon Sep 17 00:00:00 2001 From: Jun Nishimura Date: Sat, 22 Jul 2023 22:57:41 +0900 Subject: [PATCH] tiny fix for removeParentPersistentArgs --- command.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/command.go b/command.go index 5783ce7e..39042751 100644 --- a/command.go +++ b/command.go @@ -1828,9 +1828,7 @@ func (c *Command) parseShortArgs(s string, args []string) (passedArgs []string, return } -func (c *Command) removeParentPersistentArgs(args []string) []string { - var newArgs []string - +func (c *Command) removeParentPersistentArgs(args []string) (newArgs []string) { for len(args) > 0 { s := args[0] args = args[1:] @@ -1850,8 +1848,7 @@ func (c *Command) removeParentPersistentArgs(args []string) []string { } args = restArgs } - - return newArgs + return } // ParseFlags parses persistent flag tree and local flags.