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:
Aaron Gyes 2019-01-21 07:52:26 -08:00
parent 488e208cca
commit a5e5f90f73

View file

@ -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