`ls` prints a warning if a non-flag argument is specified that does not exist. Previously ls-show-hidden assumed that all arguments that are neither a directory nor an otherwise existing file are flags. As all flags are passed to the ls call the warning still got printed, but this also lead to the current working directory (i.e. `.`) being added to the directories to process. If `ls` expects an argument to a flag, it is always passed in the format `--flag=arg` where the equal sign is mandatory. This makes it possible to simply filter out all flags (and their arguments) from the other arguments without needing to know which flags take an argument and which don't. Fix this behaviour by printing the same warning as `ls` does when an argument is neither a flag, nor a directory nor an existing file. Also only add `.` to the directories if *really* only flags were passed.
3.0 KiB
Executable File
3.0 KiB
Executable File