summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2018-10-07 22:15:18 -0400
committerJakob Kaivo <jkk@ung.org>2018-10-07 22:15:18 -0400
commitd63fc8856af454356a1c02c2a7a61850c4034bab (patch)
tree69fada426cbd448f9821822039ad7a30c7c063fc
parenta92f5fd452973aec2a6c0c788a7b05f17e3e260a (diff)
still color symlinks in long listings
-rwxr-xr-xcolor-ls7
1 files changed, 6 insertions, 1 deletions
diff --git a/color-ls b/color-ls
index c84cc90..cf6fdd4 100755
--- a/color-ls
+++ b/color-ls
@@ -1,4 +1,5 @@
#!/bin/sh
+
# MIT License
#
# Copyright (c) 2018 Jakob Kaivo
@@ -21,6 +22,8 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+# TODO: handle recursive stuff
+
output=-x # TODO: change this back to -C when that is fixed
dash_F=-F
dash_1=''
@@ -115,13 +118,15 @@ _output () {
esac
}
+# TODO: grab first character from long listings
_colorize () {
awk -vcolor=0 '
+ { color=39; }
/\/$/ { color=34; }
/\*$/ { color=32; }
/\|$/ { color=33; }
/@$/ { color=35; }
- /[^/@*|]$/ { color=39; }
+ / -> / { color=35; }
{ printf("\033\[%sm%s\033\[0m\n", color, $0); }'
}