summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2018-10-14 14:56:33 -0400
committerJakob Kaivo <jkk@ung.org>2018-10-14 14:56:33 -0400
commit26c9ac00186b280d59440dde5087de594090a342 (patch)
treebff2dafc7e23ac2317881a4a63850812f194e9fd
parent0eae9a1904143419d29d35b20b84c428d36dee0b (diff)
allow for improper interpretation of -1 in OpenBSD's ls
-rwxr-xr-xcolor-ls8
1 files changed, 4 insertions, 4 deletions
diff --git a/color-ls b/color-ls
index d3b673a..044d4eb 100755
--- a/color-ls
+++ b/color-ls
@@ -29,9 +29,9 @@ options=
while getopts ACFHLRSacdfgiklmnopqrstux1 option; do
case ${option} in
- l|o|n|g) output=${option};;
- C|m|x) output=${option};;
- 1) output=1;;
+ l|o|n|g) output=${option}; one=${option};;
+ C|m|x) output=${option}; one=1;;
+ 1) output=1; one=1;;
F) trim=0;;
?) options=${options}${option};;
esac
@@ -39,4 +39,4 @@ done
shift $(($OPTIND - 1))
-exec ls -${options}F1 -- ${1+$*} | awk -vtrim=${trim} -voutput=${output} -f $(dirname $0)/color-ls.awk
+exec ls -${options}F${one} -- ${1+$*} | awk -vtrim=${trim} -voutput=${output} -f $(dirname $0)/color-ls.awk