summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2018-10-07 22:41:02 -0400
committerJakob Kaivo <jkk@ung.org>2018-10-07 22:41:02 -0400
commitb4e75fd219e0ca4b8c1b843fa3f8a670bc0b1aa1 (patch)
tree1bfe5965af62dc0b42e5b0e4b0cf0e8cfc66906f
parent67f8ac7fe5dafd77a0b73f9e256280204b72a032 (diff)
combine similar options; cut useless-use-of-cat
-rwxr-xr-xcolor-ls25
1 files changed, 10 insertions, 15 deletions
diff --git a/color-ls b/color-ls
index fa9787a..b068b79 100755
--- a/color-ls
+++ b/color-ls
@@ -24,7 +24,7 @@
# TODO: handle recursive stuff
-output=-x # TODO: change this back to -C when that is fixed
+output=x # TODO: change this back to -C when that is fixed
dash_F_specified=
need_dash_F=1
dash_1=
@@ -112,10 +112,10 @@ _commas () {
_output () {
case $output in
- -C) cat | _columns_down;;
- -x) cat | _columns_across;;
- -m) cat | _commas;;
- -1|-g|-l|-n|-o) cat;;
+ C) _columns_down;;
+ x) _columns_across;;
+ m) _commas;;
+ 1|g|l|n|o) cat;;
esac
}
@@ -142,16 +142,11 @@ _remove_symbols () {
while getopts ACFHLRSacdfgiklmopqrstux1 option
do
case $option in
- g) output=-g; dash_1=''; need_dash_F=1'';;
- l) output=-l; dash_1=''; need_dash_F=1'';;
- n) output=-n; dash_1=''; need_dash_F=1'';;
- o) output=-o; dash_1=''; need_dash_F=1'';;
- 1) output=-1; dash_1='';;
- C) output=-C; dash_1=-1; need_dash_F=1'';;
- m) output=-m; dash_1=-1; need_dash_F=1'';;
- x) output=-x; dash_1=-1; need_dash_F=1'';;
- F) dash_F_specified=-F;;
- ?) ;;
+ g|l|n|o) output=${output}; dash_1=''; need_dash_F=0;;
+ C|m|x) output=${output}; dash_1=-1; need_dash_F=1;;
+ 1) output=1; dash_1='';;
+ F) dash_F_specified=-F;;
+ ?) ;;
esac
done