From 3ca95b33f2dc650b384a96dc1d3aa3d8d18553d1 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 1 Mar 2024 19:30:33 +0200 Subject: Changes help subcommand to flag style -h, --help --- bin/ak-todos | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) (limited to 'bin/ak-todos') diff --git a/bin/ak-todos b/bin/ak-todos index 4a0a8ea..741a2f9 100755 --- a/bin/ak-todos +++ b/bin/ak-todos @@ -109,25 +109,24 @@ EOF fi } _ak_modules_todos_usage(){ - _ak_modules_todos_title - echo "#TODO" - echo "All you need to know is that there are two options available:" - echo "help Prints this help message" - echo "index Prints an indexed table of your todos files" - echo "import #TODO" - echo "add Creates a data file from the todos file you point to" - echo "create Vim is going to pop up, you will write and save your" - echo " todosletter and it's going to be saved" - exit 0 + _ak_modules_todos_title + echo "" + echo "-h, --help Prints this help message" + echo "index Prints an indexed table of your todos files" + echo "import #TODO" + echo "add Creates a data file from the todos file you point to" + echo "create Vim is going to pop up, you will write and save your" + echo " todosletter and it's going to be saved" + exit 0 } if [ ! -z $1 ]; then - case $1 in - help) _ak_modules_todos_usage; exit;; - index) _ak_modules_todos_index; exit;; - import) _ak_modules_todos_import $2; exit;; - add) _ak_modules_todos_add $2; exit;; - create) _ak_modules_todos_create; exit;; - * ) _ak_modules_todos_usage;; - esac + case $1 in + -h | --help) _ak_modules_todos_usage; exit;; + index) _ak_modules_todos_index; exit;; + import) _ak_modules_todos_import $2; exit;; + add) _ak_modules_todos_add $2; exit;; + create) _ak_modules_todos_create; exit;; + * ) _ak_modules_todos_usage;; + esac else _ak_modules_todos_usage fi -- cgit v1.2.3