summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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); }'
}