Add usage help
authorSiraaj Khandkar <siraaj@khandkar.net>
Thu, 4 Aug 2022 20:35:50 +0000 (16:35 -0400)
committerSiraaj Khandkar <siraaj@khandkar.net>
Thu, 4 Aug 2022 20:35:50 +0000 (16:35 -0400)
home/bin/wallpaper_review

index 66d7e4f..8b15bcb 100755 (executable)
@@ -154,11 +154,30 @@ key | action
 EOF
 }
 
+usage() {
+    cat <<EOF >&2
+
+$(basename "$0") [cmd]
+
+cmd | args  | meaning
+----+-------+------------------------------------------------
+ f  |       | favorites
+ d  | <dir> | from given dir
+ a  |       | all from $DIR_WALLPAPERS <- DEFAULT if no cmd.
+ h  |       | usage help. i.e. this message.
+----+-------+------------------------------------------------
+
+EOF
+}
+
 main() {
     case "$1" in
         f | fav) paths_set_from_favs;;
         d | dir) paths_set_from_dir_find "$2";;
         a | all) paths_set_from_dir_find "$DIR_WALLPAPERS";;
+        h | -h | help | -help | --help)
+            usage;
+            exit 1;;
         '')
             paths_set_from_dir_find "$DIR_WALLPAPERS";;
         *)
This page took 0.029462 seconds and 4 git commands to generate.