mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-06 00:31:13 -03:00
implement -nnn style flags in argparse
This implements support for numeric flags without an associated short or long flag name. This pattern is used by many commands. For example `head -3 /a/file` to emit the first three lines of the file. Fixes #4214
This commit is contained in:
@@ -6,7 +6,7 @@ argparse: Missing -- separator
|
||||
argparse: No option specs were provided
|
||||
# Invalid option specs
|
||||
argparse: Invalid option spec 'h-' at char '-'
|
||||
argparse: Invalid option spec '+help' at char 'h'
|
||||
argparse: Short flag '+' invalid, must be alphanum or '#'
|
||||
argparse: Invalid option spec 'h/help:' at char ':'
|
||||
argparse: Invalid option spec 'h-help::' at char ':'
|
||||
argparse: Invalid option spec 'h-help=x' at char 'x'
|
||||
@@ -14,3 +14,10 @@ argparse: Invalid option spec 'h-help=x' at char 'x'
|
||||
min-max: Expected at least 1 args, got only 0
|
||||
min-max: Expected at most 3 args, got 4
|
||||
min-max: Expected at most 1 args, got 2
|
||||
# Invalid "#-val" spec
|
||||
argparse: Short flag '#' does not allow modifiers like '='
|
||||
# Invalid arg in the face of a "#-val" spec
|
||||
argparse: Unknown option '-x'
|
||||
Standard input (line 38):
|
||||
argparse '#-val' -- abc -x def
|
||||
^
|
||||
|
||||
Reference in New Issue
Block a user