commit 7a13363787fafd2e36779d9262dce718726a18ef
parent f651e4d6c4f558aae8e513089a5c5af86aad7000
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Mon, 18 Oct 2021 14:25:25 -0700
Revise cleanpath script
Insert a separator between all lower-case and upper-case letters
instead of only capital letters which appear inbetween lower-case
letters.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/local/bin/bin/cleanpath b/local/bin/bin/cleanpath
@@ -3,13 +3,13 @@
# cleanpath - Process names to make them easier to type
# [cleanname, the perfect name, is taken by plan9]
#
-# 1. Insert separators between camel-case words
+# 1. Insert separators between lower-case and upper-case letters
# 2. Replace most punctuation with space or nothing (including all but the last period)
# 3. Replace space with hyphen
# 4. Replace excess hyphens with nothing
# 5. Replace upper-case letters with their lower-case equivilents
-sed -E 's/([^A-Z])([A-Z][^A-Z])/\1 \2/g
+sed -E 's/([^A-Z])([A-Z])/\1 \2/g
s/'\''//g
s/[]!"#$%&()+,:;<>@[\\^{|}~]/ /g
s/\.([^.]*\.)/-\1/g