diff options
-rwxr-xr-x | wd | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -78,12 +78,11 @@ cmd_git () { cd "$WD_NOTES_DIR" && git "$@" } -if [ "$#" -eq 0 ]; then - "$PROGRAM" "$WD_DEFAULT_SUBCOMMAND" - exit 0 -fi -case "$1" in +subcommand="$WD_DEFAULT_SUBCOMMAND" +[ "$#" -ne 0 ] && subcommand="$1" + +case "$subcommand" in help|--help|-h) shift; cmd_usage "$@";; version|--version|-v) shift; cmd_version "$@";; journal|j) shift; cmd_journal "$@";; |