]> gitweb.morketsmerke.org Git - idle.git/commitdiff
Poprawienie ścieżki wskazującej na główną bibliotekę. Uruchomienie opcji 'check-comma...
authorxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 17:59:33 +0000 (19:59 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Mon, 7 Aug 2023 17:59:33 +0000 (19:59 +0200)
idle-clis [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 90c200f..5632132
--- a/idle-clis
+++ b/idle-clis
@@ -1,13 +1,37 @@
 #!/bin/bash
 
+RED="\e[31m";
+GREEN="\e[32m";
+ENDCOLOR="\e[0m";
+YES="\u2714";
+NO="\u2716";
+
+function ckcmd() {
+  cmd=$2;
+  idle-exec-command $1 $cmd > /dev/null 2>&1;
+  if [ $? -eq 0 ]; then echo -e "${1}: $2 ${GREEN}${YES}${ENDCOLOR}";
+  else echo -e "${1}: $2 ${RED}${NO}${ENDCOLOR}";
+  fi
+}
+
 if [ $# -gt 0 ]; then
-  source /usr/share/local/idle;
+  source /usr/local/bin/idle;
   command=$1;
   shift;
   case $command in
     "list-distros") idle-list-containers; break;;
     "shell") idle-exec-shell $2; exit;;
-    "check-command") idle-exec-command $2; exit;;
+    "check-command") 
+      containerName=$1;
+      if [ "$containerName" = "--all" ]; then
+        containerList=$(idle-list-containers | awk '{printf $1" "}' | sed 's/://g');
+        for containerName in $containerList; do
+         ckcmd $containerName $2;
+        done
+      else
+        ckcmd $containerName $2;
+      fi
+      exit;;
     "apropos") idle-apropos $@; exit;;
     "pkgsearch") idle-pkg-search $@; break;;
   esac