mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
fix(lib): use shift+"$@" in test-ls-args to preserve argument separation
This commit is contained in:
parent
9df4ea095f
commit
3e21d93c84
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
local cmd="$1" # ls, gls, colorls, ...
|
||||
shift # remove the command, leaving only the arguments
|
||||
command "$cmd" "$@" /dev/null &>/dev/null
|
||||
}
|
||||
|
||||
# Find the option for using colors in ls, depending on the version
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue