From 7a0f61e6a578f0180d64bf62edeb2289043bdbf4 Mon Sep 17 00:00:00 2001 From: luyanbo Date: Mon, 11 Oct 2021 01:28:57 +0800 Subject: [PATCH] support -f example --- command.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command.go b/command.go index ab6ec45a..c46885df 100644 --- a/command.go +++ b/command.go @@ -603,6 +603,11 @@ Loop: args = args[1:] continue } + case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && shortHasNoOptDefVal(s[1:], flags): + // If '-f' then + // delete '-f' from args or break the loop if len(args) <= 1. + beforeArgs = append(beforeArgs, s) + continue case s != "" && !strings.HasPrefix(s, "-"): command = s afterArgs = args