From f7b57065dbb06ac9d9a19e696fe039f111758163 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Mon, 22 Jan 2024 21:40:54 +0100 Subject: [PATCH] docs/command: Simplify This prefers `-s` to `-v` - we have a *lot* more uses of `command -s`, it's the easier mnemonic *and* the more compatible-with-fish option. Also we don't really need the separate section that explains what these options do *again*. --- doc_src/cmds/command.rst | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc_src/cmds/command.rst b/doc_src/cmds/command.rst index d4f046835..105c7dcf2 100644 --- a/doc_src/cmds/command.rst +++ b/doc_src/cmds/command.rst @@ -23,21 +23,20 @@ The following options are available: Prints all *COMMAND* found in :envvar:`PATH`, in the order found. **-q** or **--query** - Silence output and print nothing, setting only exit status. - Implies **--search**. + Return 0 if any of the given commands could be found, 127 otherwise. + Don't print anything. For compatibility, this is also **--quiet** (deprecated). -**-v** (or **-s** or **--search**) +**-s** or **--search** (or **-v**) Prints the external command that would be executed, or prints nothing if no file with the specified name could be found in :envvar:`PATH`. **-h** or **--help** Displays help about using this command. -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`` 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. +| ``command -sq git`` and ``command -q git`` and ``command -vq git`` return true (0) if a git command could be found and don't print anything.