mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-30 11:21:15 -03: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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user