about summary refs log tree commit diff stats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xhm/soispha/pkgs/scripts/specific/ytcc/yts50
1 files changed, 26 insertions, 24 deletions
diff --git a/hm/soispha/pkgs/scripts/specific/ytcc/yts b/hm/soispha/pkgs/scripts/specific/ytcc/yts
index 534151a6..60c4e2db 100755
--- a/hm/soispha/pkgs/scripts/specific/ytcc/yts
+++ b/hm/soispha/pkgs/scripts/specific/ytcc/yts
@@ -56,31 +56,33 @@ for arg in "$@"; do
     esac
 done
 
-case "$1" in
-    "order")
-        shift 1;
-        case "$1" in
-            "date")
-                    set -- "--order-by" "publish_date" "desc"
+if [ -n "$1" ]; then
+    case "$1" in
+        "order")
+            shift 1;
+            case "$1" in
+                "date")
+                        set -- "--order-by" "publish_date" "desc"
+                        oder_mode_set=true;
+                    ;;
+                "raw")
+                    shift 1;
+                    if [ -n "$1" ]; then
+                        [ -z "$2" ] && die "A first argument to 'order raw' requires a second"
+                        set -- "--order-by" "$1" "$2"
+                    fi
                     oder_mode_set=true;
-                ;;
-            "raw")
-                shift 1;
-                if [ -n "$1" ]; then
-                    [ -z "$2" ] && die "A first argument to 'order raw' requires a second"
-                    set -- "--order-by" "$1" "$2"
-                fi
-                oder_mode_set=true;
-                ;;
-            *)
-                die "'$1' is not a valid subcommand for 'order'; See '--help' for a list";
-                ;;
-        esac
-        ;;
-    *)
-        die "'$1' is not a valid subcommand; See '--help' for a list";
-        ;;
-esac
+                    ;;
+                *)
+                    die "'$1' is not a valid subcommand for 'order'; See '--help' for a list";
+                    ;;
+            esac
+            ;;
+        *)
+            die "'$1' is not a valid subcommand; See '--help' for a list";
+            ;;
+    esac
+fi
 
 # Set the default ordering mode
 [ -z "$oder_mode_set" ] && set -- "--order-by" "publish_date" "desc"