complete: Add "--force-files"

This allows a completion to specify that *it* takes files.

Useful for things like `sudo -e`, because sudo usually doesn't take
any files.
This commit is contained in:
Fabian Homborg
2019-05-30 19:12:49 +02:00
parent d28e8fb7de
commit 4ebb6cf39e
6 changed files with 30 additions and 6 deletions

View File

@@ -16,6 +16,7 @@ Synopsis
[( -a | --arguments ) OPTION_ARGUMENTS]
[( -k | --keep-order )]
[( -f | --no-files )]
[( -F | --force-files )]
[( -r | --require-parameter )]
[( -x | --exclusive )]
[( -w | --wraps ) WRAPPED_COMMAND]...
@@ -56,9 +57,11 @@ the fish manual.
- ``-k`` or ``--keep-order`` preserves the order of the ``OPTION_ARGUMENTS`` specified via ``-a`` or ``--arguments`` instead of sorting alphabetically. Multiple ``complete`` calls with ``-k`` result in arguments of the later ones displayed first.
- ``-f`` or ``--no-files`` specifies that the options specified by this completion may not be followed by a filename.
- ``-f`` or ``--no-files`` says that the options specified by this completion may not be followed by a filename.
- ``-r`` or ``--require-parameter`` specifies that the options specified by this completion always must have an option argument, i.e. may not be followed by another option.
- ``-F`` or ``--force-files`` says that the options specified by this completion may be followed by a filename, even if another applicable ``complete`` specified ``--no-files``.
- ``-r`` or ``--require-parameter`` says that the options specified by this completion must have an option argument, i.e. may not be followed by another option.
- ``-x`` or ``--exclusive`` implies both ``-r`` and ``-f``.