automatically call subcommand help, if subcommand is empty

This commit is contained in:
LinuxSquare 2025-04-10 22:26:45 +02:00
parent 702aa821ab
commit 12833d4490

View file

@ -81,4 +81,8 @@ if ! grep "$SUBCOMMAND" "$ROOTPATH/functions/$COMMAND" &> /dev/null; then
fi fi
source "$ROOTPATH/functions/$COMMAND" source "$ROOTPATH/functions/$COMMAND"
if [[ -z "$SUBCOMMAND" ]]; then
"${COMMAND}_help"
exit 1
fi
"${COMMAND}_${SUBCOMMAND}" ${PARAMS[@]} "${COMMAND}_${SUBCOMMAND}" ${PARAMS[@]}