From 370b05b5d682dffb13cf018d5bf8174bfbce0dfb Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Mon, 19 Feb 2024 23:11:34 +0300 Subject: [PATCH 1/3] Feat(recode-filenames-recursive): Allow to omit parameters --- bin/recode-filenames-recursive.py | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/bin/recode-filenames-recursive.py b/bin/recode-filenames-recursive.py index b7787e4..5408563 100755 --- a/bin/recode-filenames-recursive.py +++ b/bin/recode-filenames-recursive.py @@ -1,14 +1,34 @@ #! /usr/bin/env python3 import sys, os -from recode_filenames import _recode -if len(sys.argv) == 3: +from m_lib.defenc import default_encoding + +if len(sys.argv) == 1: + src_encoding = default_encoding + if src_encoding == 'utf-8': + sys.exit("Usage: %s [[src_enc] dst_enc [start_dir]]" % sys.argv[0]) + else: + dst_encoding = 'utf-8' + start_dir = '.' +elif len(sys.argv) == 2: + src_encoding = default_encoding + dst_encoding = sys.argv[1] start_dir = '.' +elif len(sys.argv) == 3: + src_encoding = default_encoding + dst_encoding = sys.argv[1] + start_dir = sys.argv[2] elif len(sys.argv) == 4: + src_encoding = sys.argv[1] + dst_encoding = sys.argv[2] start_dir = sys.argv[3] else: - sys.exit("Usage: %s src_enc dst_enc [start_dir]" % sys.argv[0]) + sys.exit("Usage: %s [[src_enc] dst_enc [start_dir]]" % sys.argv[0]) + +# Fake for recode_filenames.py +sys.argv = ['', src_encoding, dst_encoding] +from recode_filenames import _recode def _onerror(exc): -- 2.39.2 From 497fea9aa534f31b5469599f52f1d266da61de8e Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 4 May 2024 00:51:34 +0300 Subject: [PATCH 2/3] Fix(bin/mplay): Fix option syntax --- bin/mplay | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/mplay b/bin/mplay index e4ca110..decfbfe 100755 --- a/bin/mplay +++ b/bin/mplay @@ -1,6 +1,6 @@ #! /bin/sh -options="--ao pulse --quiet" +options="--ao=pulse --quiet" if [ -n "$AUDIO_VOLUME" ]; then options="$options --af=loudnorm --volume=$AUDIO_VOLUME" -- 2.39.2 From 962bab306b571f816a4a200743a0ca4d8587c0c9 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sat, 4 May 2024 00:51:57 +0300 Subject: [PATCH 3/3] Fix(bin/cp_recode_fname): Fix misspelled message --- bin/cp_recode_fname | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cp_recode_fname b/bin/cp_recode_fname index 8cae733..d6dd74b 100755 --- a/bin/cp_recode_fname +++ b/bin/cp_recode_fname @@ -31,7 +31,7 @@ case "$cmd" in cp_*) cmd="cp -p" ;; mv_*) cmd=mv ;; *) - echo "Uncnown command $0, aborting" >&2 + echo "Unknown command $0, aborting" >&2 exit 2 ;; esac -- 2.39.2