mirror of
https://github.com/robbyrussell/oh-my-zsh.git
synced 2026-09-23 03:26:08 +02:00
docs(appearance): describe the /dev/null operand __omz_test_cmd_args appends
The doc comment didn't explain why the diff probe passes /dev/null explicitly, which read as a mistake rather than the second operand diff requires. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
e1d7934216
commit
b0934e5646
@@ -22,8 +22,10 @@ __omz_probe_cached=("$__omz_probe_cache"(Nm-1))
|
||||
|
||||
function __omz_test_cmd_args {
|
||||
# Usage: __omz_test_cmd_args cmd args...
|
||||
# e.g. __omz_test_cmd_args gls --color
|
||||
# Runs `cmd args... /dev/null` and remembers whether it succeeded
|
||||
# Runs `cmd args... /dev/null` and remembers whether it succeeded, so a
|
||||
# command needing two operands passes the first one itself:
|
||||
# e.g. __omz_test_cmd_args gls --color -> gls --color /dev/null
|
||||
# __omz_test_cmd_args diff --color /dev/null -> diff --color /dev/null /dev/null
|
||||
local key="$*"
|
||||
if (( ! ${+__omz_probes[$key]} )); then
|
||||
command "$@" /dev/null &>/dev/null
|
||||
|
||||
Reference in New Issue
Block a user