fix(appearance): ensure arg separation in test-ls-args (#13556)
Some checks failed
Scorecard supply-chain security / Scorecard analysis (push) Failing after 1s

Co-authored-by: Marc Cornellà <marc@mcornella.com>
This commit is contained in:
Ranga Nirmal 2026-02-11 17:01:06 +05:30 committed by GitHub
commit 88659ed193
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -40,9 +40,9 @@ if [[ -z "$LS_COLORS" ]]; then
fi
function test-ls-args {
local cmd="$1" # ls, gls, colorls, ...
local args="${@[2,-1]}" # arguments except the first one
command "$cmd" "$args" /dev/null &>/dev/null
# Usage: test-ls-args cmd args...
# e.g. test-ls-args gls --color
command "$@" /dev/null &>/dev/null
}
# Find the option for using colors in ls, depending on the version