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:
Robby Russell
2026-09-07 07:56:52 -07:00
co-authored by Claude Opus 5
parent e1d7934216
commit b0934e5646
+4 -2
View File
@@ -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