mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 09:31:16 -03:00
argparse: Allow usage without optspecs
It's still useful without, for instance to implement a command that takes no options, or to check min-args or max-args. (technically no optspecs, no min/max args and --ignore-unknown does nothing, but that's a very specific error that we don't need to forbid) Fixes #9006
This commit is contained in:
@@ -64,10 +64,11 @@ If ``$argv`` is empty then there is nothing to parse and ``argparse`` returns ze
|
||||
|
||||
The ``or return`` means that the function returns ``argparse``'s status if it failed, so if it goes on ``argparse`` succeeded.
|
||||
|
||||
The ``--`` argument is required. You do not have to include any arguments after the ``--`` but you must include the ``--``. For example, this is acceptable::
|
||||
The ``--`` argument is required. You do not have to include any option specifications or arguments after the ``--`` but you must include the ``--``. For example, this is acceptable::
|
||||
|
||||
set -l argv
|
||||
set -l argv foo
|
||||
argparse 'h/help' 'n/name' -- $argv
|
||||
argparse --min-args=1 -- $argv
|
||||
|
||||
But this is not::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user