]> gitweb.morketsmerke.org Git - immudex.git/commitdiff
Próba wdrożenia bash-completion dla narzędzi autorskich immudex cz.4.
authorxf0r3m <jakubstasinski@protonmail.com>
Thu, 28 May 2026 13:08:30 +0000 (15:08 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Thu, 28 May 2026 13:08:30 +0000 (15:08 +0200)
tools/bin/immudex-commit [moved from tools/bin/immudex-version with 92% similarity]
tools/bin/immudex-ytplay
tools/completions/immudex-pl
tools/man/immudex-commit.1.gz [new file with mode: 0644]
tools/man/immudex-version.1.gz [deleted file]
tools/sbin/immudex-install

similarity index 92%
rename from tools/bin/immudex-version
rename to tools/bin/immudex-commit
index 2e7d497ef13af4e5b622189d9c7ca64691a039f7..b3e4e4b1b0fe410297dc1248e8df896d274f2b4f 100755 (executable)
@@ -3,7 +3,7 @@
 function help() {
   echo "Script returns first 7 signs of immudex commit ID.";
   echo;
-  echo "Usage: immudex-version [-h] [-v]";
+  echo "Usage: immudex-commit [-h] [-v]";
   echo;
   echo "Options:";
   echo "  -h   Print this message.";
@@ -16,7 +16,7 @@ function help() {
 }
 
 function version(){
-  echo "immudex-version 1.1";
+  echo "immudex-commit 1.0";
   echo;
   echo "Copyright (C) 2026 morketsmerke.org";
   echo "This is free software; see the source for copying conditions.  There is NO";
index 29901e24f58a5482b82005196829d0772eb36d7b..a1fb8f2b20bd7c8c80eb743b0c14d5d1a791fbea 100755 (executable)
@@ -63,7 +63,7 @@ def ytSearch(keywords, maxResults=15):
 def getFormat(videoID):
   subprocess.run(['yt-dlp', '--list-formats', 'https://youtube.com/watch?v=' + videoID])
   f = input("Please choose youtube video format, you need put video+audio ID of quality in this format or type anything else to quit:")
-  if not re.search("[0-9]{3}\+[0-9]{3}|[0-9]{2}", f):
+  if not re.search(r"[0-9]{3}\\+[0-9]{3}|[0-9]{2}", f):
     sys.exit(0)
   else:
     return f 
@@ -84,14 +84,14 @@ option=sys.argv[1]
 
 if option == '-s':
   if len(sys.argv) > 2:
-    if sys.argv[2] == '-v':
+    if sys.argv[3] == '-v':
       mode = "video"
     elif sys.argv[2] == '-a':
       mode = "audio"
     else:
       usage()
       sys.exit(2)
-    keywords = sys.argv[1]
+    keywords = sys.argv[2]
     
     video = ytSearch(keywords)
     subprocess.run('clear')
index 62cd61c147b47632af1610b1bdcfc2a9bbbe9c13..d356c871fb29a59ecb876223a113f83806767e4f 100644 (file)
@@ -10,6 +10,8 @@ idx_pl_complete() {
     COMPREPLY=( $(compgen -W '-h -i -v' -- $cur) );
   elif [ $COMP_CWORD -eq 2 ]; then
     return 0;
+  else
+    _comp_compgen_filedir
   fi
   return 0;
  
diff --git a/tools/man/immudex-commit.1.gz b/tools/man/immudex-commit.1.gz
new file mode 100644 (file)
index 0000000..4878f60
Binary files /dev/null and b/tools/man/immudex-commit.1.gz differ
diff --git a/tools/man/immudex-version.1.gz b/tools/man/immudex-version.1.gz
deleted file mode 100644 (file)
index 281a77a..0000000
Binary files a/tools/man/immudex-version.1.gz and /dev/null differ
index 18139c10aa71159323b9e358de2637884622d066..fa39ced33618c3d8ec7db41aaae3f39665909076 100755 (executable)
@@ -54,7 +54,7 @@ if [ "$1" ]; then
   fi
 fi
 if [ "$1" ]; then
-  if $(echo $1 | grep -q '-p'); then
+  if $(echo $1 | grep -q "\-p"); then
     if [ "$2" ]; then
       idxPartSize=$2;
     else