diff --git a/command.go b/command.go index 3993e0ff15..037abe97a1 100644 --- a/command.go +++ b/command.go @@ -217,7 +217,7 @@ func (c *Command) useShortOptionHandling() bool { // reorderArgs moves all flags (via reorderedArgs) before the rest of // the arguments (remainingArgs) as this is what flag expects. func reorderArgs(commandFlags []Flag, args []string) []string { - var remainingArgs []string + var remainingArgs, reorderedArgs []string var reorderedArgs []string nextIndexMayContainValue := false