summaryrefslogtreecommitdiff
path: root/parse.go
diff options
context:
space:
mode:
authorPablo Diaz <[email protected]>2022-05-21 17:24:45 +0200
committerIlja Neumann <[email protected]>2023-06-03 02:39:56 +0200
commitc3cac76438ca36d9291d2a26f3ba558ef929d588 (patch)
tree8d5d3d069d417d3c7b5f4e6f0d568d9fd11fce44 /parse.go
parent0280e6e5911d4198f69eae9c876722fdf6149b89 (diff)
added tests and fixed usage
Diffstat (limited to 'parse.go')
-rw-r--r--parse.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse.go b/parse.go
index e5df067..aee60e7 100644
--- a/parse.go
+++ b/parse.go
@@ -656,7 +656,7 @@ func (p *Parser) process(args []string) error {
// lookup the spec for this option (note that the "specs" slice changes as
// we expand subcommands so it is better not to use a map)
spec := findOption(specs, opt)
- if spec == nil {
+ if spec == nil || opt == "" {
return fmt.Errorf("unknown argument %s", arg)
}
wasPresent[spec] = true