diff options
author | Guangxiong Lin <[email protected]> | 2022-11-20 23:12:30 +0800 |
---|---|---|
committer | Guangxiong Lin <[email protected]> | 2022-11-20 23:12:30 +0800 |
commit | ac8791df68c515a57be4696d70ed382fe31a37d0 (patch) | |
tree | d0ec43537c6c02cb92ca7eddb25851d3e7ad6b86 | |
parent | ec1a3a87f9e8eb48c81ea35c0ec35c3fe3c71386 (diff) | |
download | wd-ac8791df68c515a57be4696d70ed382fe31a37d0.tar.gz wd-ac8791df68c515a57be4696d70ed382fe31a37d0.tar.bz2 wd-ac8791df68c515a57be4696d70ed382fe31a37d0.zip |
Support default command
-rwxr-xr-x | wd | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -7,6 +7,7 @@ PROGRAM="$(basename $0)" WD_NOTES_DIR=${WD_NOTES_DIR:-"$HOME/notes"} WD_JOURNALS_DIR=${WD_JOURNALS_DIR:-"$WD_NOTES_DIR/journals"} +WD_DEFAULT_SUBCOMMAND=${WD_DEFAULT_SUBCOMMAND:-help} year=$(date +%Y) week_number=$(date +%W) @@ -69,6 +70,11 @@ cmd_git () { cd "$WD_NOTES_DIR" && git "$@" } +if [ "$#" -eq 0 ]; then + "$PROGRAM" "$WD_DEFAULT_SUBCOMMAND" + exit 0 +fi + case "$1" in help|--help|-h) shift; cmd_usage "$@";; version|--version|-v) shift; cmd_version "$@";; |