mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-15 01:17:45 +00:00
ls.fish: fix colorless ls not taking options
That -- no-op would have the effect that a user can not pass more options to ls, they would be interpreted as file names.
This commit is contained in:
parent
488e208cca
commit
a5e5f90f73
1 changed files with 2 additions and 2 deletions
|
@ -5,9 +5,9 @@
|
|||
# BSD, macOS and others support colors with ls -G.
|
||||
# GNU ls and FreeBSD ls takes --color=auto. Order of this test is important because ls also takes -G but it has a different meaning.
|
||||
# Solaris 11's ls command takes a --color flag.
|
||||
# Also test a no-op -- because we'll want to define this function even with an ls that can't do colors (like NetBSD).
|
||||
# Also test -F because we'll want to define this function even with an ls that can't do colors (like NetBSD).
|
||||
|
||||
for opt in --color=auto -G --color --
|
||||
for opt in --color=auto -G --color -F
|
||||
if command ls $opt / >/dev/null 2>/dev/null
|
||||
|
||||
function ls --description "List contents of directory" -V opt
|
||||
|
|
Loading…
Reference in a new issue