Update command.rst

This commit is contained in:
Aaron Gyes 2021-12-12 00:17:16 -08:00 committed by GitHub
parent f464bbebfe
commit 5e96f817a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,11 +26,11 @@ The following options are available:
**-v** (or **-s** or **--search**)
Prints the external command that would be executed, or prints nothing if no file with the specified name could be found in :envvar:`PATH`.
With the **-v** option, ``command`` treats every argument as a separate command to look up and sets the exit status to 0 if any of the specified commands were found, or 1 if no commands could be found. Additionally passing **--quiet** option prevents any paths from being printed, like ``type -q``.
With the **-v** option, ``command`` treats every argument as a separate command to look up and sets the exit status to 0 if any of the specified commands were found, or 127 if no commands could be found. **--quiet** used with **-v** prevents commands being printed, like ``type -q``.
Examples
--------
| ``command ls`` causes fish to execute the ``ls`` program, even if an ``ls`` function exists.
| ``command -s ls`` returns the path to the ``ls`` program.
| ``command ls`` executes the ``ls`` program, even if an ``ls`` function also exists.
| ``command -s ls`` prints the path to the ``ls`` program.
| ``command -q git; and command git log`` runs ``git log`` only if ``git`` exists.