diff options
Diffstat (limited to 'doc_src/command.txt')
-rw-r--r-- | doc_src/command.txt | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/doc_src/command.txt b/doc_src/command.txt index 19baccd4..4f9087d6 100644 --- a/doc_src/command.txt +++ b/doc_src/command.txt @@ -1,12 +1,24 @@ \section command command - run a program \subsection command-synopsis Synopsis -<tt>command COMMANDNAME [OPTIONS...]</tt> +\fish{synopsis} +command [OPTIONS] COMMANDNAME [ARGS...] +\endfish \subsection command-description Description -\c command forces the shell to execute the program \c COMMANDNAME and ignore any functions or builtins with the same name. +`command` forces the shell to execute the program `COMMANDNAME` and ignore any functions or builtins with the same name. -\subsection command-example Example +The following options are available: -<tt>command ls</tt> causes fish to execute the \c ls program, even if an 'ls' function exists. +- `-s` or `--search` returns the name of the disk file that would be executed, or nothing if no file with the specified name could be found in the `$PATH`. + +With the `-s` 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. + +For basic compatibility with POSIX `command`, the `-v` flag is recognized as an alias for `-s`. + +\subsection command-example 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. |