diff options
| author | Pablo Diaz <[email protected]> | 2022-05-21 17:24:45 +0200 |
|---|---|---|
| committer | Ilja Neumann <[email protected]> | 2023-06-03 02:39:56 +0200 |
| commit | c3cac76438ca36d9291d2a26f3ba558ef929d588 (patch) | |
| tree | 8d5d3d069d417d3c7b5f4e6f0d568d9fd11fce44 /parse.go | |
| parent | 0280e6e5911d4198f69eae9c876722fdf6149b89 (diff) | |
added tests and fixed usage
Diffstat (limited to 'parse.go')
| -rw-r--r-- | parse.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 |
