]> Sergey Matveev's repositories - torn.git/blobdiff - torn.zsh
Typo
[torn.git] / torn.zsh
index 7c2876c611b5631242cfaa274351aa6eaa0597f5..69ec947335c4021212372ebbd7e43cc796333b7a 100755 (executable)
--- a/torn.zsh
+++ b/torn.zsh
@@ -1,13 +1,13 @@
 # torn - Musical files renaming with russian language transliteration
-# Copyright (C) 2021-2023 Sergey Matveev (stargrave@stargrave.org)
+# Copyright (C) 2021-2024 Sergey Matveev (stargrave@stargrave.org)
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation, version 3 of the License.
 
-# Initially this script was written on Perl, but now it is zsh function,
-# that is intended to be used with zmv command. It is much more flexible
-# to be used with zsh'es glob expansion.
+# Initially this script was written on Perl, but now it is Z shell
+# function, that is intended to be used with zmv command. It is much
+# more flexible to be used with zsh'es glob expansion.
 #
 # * transliterates everything
 # * replaces non FAT-compatible characters with underscores
@@ -22,7 +22,7 @@
 # You can run like that:
 #   $ fpath=(... $fpath)
 #   $ autoload torn
-#   $ zmv "*" '`torn $f`"
+#   $ zmv "*" '`torn $f`'
 #
 # Transliteration function is separate tornt(), so you can use only
 # its abilities:
@@ -52,6 +52,8 @@ tornm() {
     local n=$1
     n=${n:gs/ /_}
     n=${n//_[–-]_/-}
+    n=${n//_[–-]/-}
+    n=${n//[–-]_/-}
     n=${n:gs/,_/,}
     n=${n//[\[\]]/}
     n=${n:gs/_(/(}