From: Siraaj Khandkar Date: Thu, 4 Aug 2022 20:35:50 +0000 (-0400) Subject: Add usage help X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=24fe724930dfa50bde13d88f4d56b29585541d5b;p=khome.git Add usage help --- diff --git a/home/bin/wallpaper_review b/home/bin/wallpaper_review index 66d7e4f..8b15bcb 100755 --- a/home/bin/wallpaper_review +++ b/home/bin/wallpaper_review @@ -154,11 +154,30 @@ key | action EOF } +usage() { + cat <&2 + +$(basename "$0") [cmd] + +cmd | args | meaning +----+-------+------------------------------------------------ + f | | favorites + d | | 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";; *)