From 24fe724930dfa50bde13d88f4d56b29585541d5b Mon Sep 17 00:00:00 2001 From: Siraaj Khandkar Date: Thu, 4 Aug 2022 16:35:50 -0400 Subject: [PATCH] Add usage help --- home/bin/wallpaper_review | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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";; *) -- 2.20.1