aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/command.txt
diff options
context:
space:
mode:
authorGravatar Kevin Ballard <kevin@sb.org>2014-07-09 18:21:06 -0700
committerGravatar Kevin Ballard <kevin@sb.org>2014-07-13 19:11:29 -0700
commitcc565fc16c69affeda4a7e8a1c8d7e419fc5c519 (patch)
tree2114971f50b55a8992f2165afaead7565020a665 /doc_src/command.txt
parent62d86b3d18feb24f93d615cfadfe1fbad86ef118 (diff)
Teach `command` builtin a -p/--path flag
Give the `command` builtin a single flag, -p/--path, that causes it to print the full path that would be executed for the given command.
Diffstat (limited to 'doc_src/command.txt')
-rw-r--r--doc_src/command.txt12
1 files changed, 10 insertions, 2 deletions
diff --git a/doc_src/command.txt b/doc_src/command.txt
index 19baccd4..e93f34b8 100644
--- a/doc_src/command.txt
+++ b/doc_src/command.txt
@@ -1,12 +1,20 @@
\section command command - run a program
\subsection command-synopsis Synopsis
-<tt>command COMMANDNAME [OPTIONS...]</tt>
+<tt>command [OPTIONS] COMMANDNAME [ARGS...]</tt>
\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.
-\subsection command-example Example
+The following options are available:
+- \c -h or \c --help prints help and then exits.
+- \c -p or \c --path 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 <tt>$PATH</tt>.
+
+With the \c -p option, \c 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.
+
+\subsection command-example Examples
<tt>command ls</tt> causes fish to execute the \c ls program, even if an 'ls' function exists.
+
+<tt>command -p ls</tt> returns the path to the \c ls program.