Adds a --quiet/-q option for command -s#3591
Conversation
|
As I read this, this still accepts "-q" without "-s" as a noop. Personally, I'm okay with that, but there might be reasons to error out - I think @krader1961 likes behavior like that. |
No, that's an error and the help is printed. edit: oops, I hit the close pull request instead of the green comment button. |
|
( This function here only does the argument handling aspect of the builtin, outside the parser, and it already was causing errors unless |
I think devnull'ing this builtin to check presence is a common enough chore that a --quiet option which works like it does on `type` would be handy.
This was a new addition to provide a simple way of checking whether a command exists in scripts. See: fish-shell/fish-shell#3591
|
How does this compare to |
Using |
Description
I think devnull'ing
command -v program_nameto check presence is a commonenough chore that a
--quietoption which works like it does ontypewould be handy for writers of shell scripts. Simply mutes the output for checking the exit status.command -qs fooshould behave identically tocommand -s foo >/dev/null,command -v foo >/dev/nullIncludes updated documentation.