aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2024-01-06 21:36:00 +0100
committerSoispha <soispha@vhack.eu>2024-01-06 21:36:00 +0100
commit98fd08f7b943e01f3ba585b3faa73ebfa9034de6 (patch)
treeeb6dfc03940b5df992d67417691cd3c2d66bfbbb
parentfix(hm/pkgs/scr/specific/ytcc/yts): Only trap the task stop if it's started (diff)
downloadnixos-config-98fd08f7b943e01f3ba585b3faa73ebfa9034de6.zip
fix(hm/pkgs/scr/specific/ytcc/yts): Actually make the subcommands optional
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"