summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwd9
1 files changed, 4 insertions, 5 deletions
diff --git a/wd b/wd
index 5880f98..3da1519 100755
--- a/wd
+++ b/wd
@@ -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 "$@";;