From 42f1d9af0b67e47414172b51a6a10177027a6572 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sun, 28 Aug 2022 14:07:54 +0200 Subject: support --help/-h command line options --- functions/mark.fish | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'functions') diff --git a/functions/mark.fish b/functions/mark.fish index 8c6080f..80e373b 100644 --- a/functions/mark.fish +++ b/functions/mark.fish @@ -112,13 +112,17 @@ function __mark_append_mark --argument mark date end end +function __mark_print_usage + echo "Usage: mark [cmd | ] date [cmd args]" + echo "Cmds:" + echo " print [before] [after]: print marks in range [date-before, date-after]" + echo " edit: open the mark store file in an editor or using xdg-open" +end + function mark --argument cmd date if test -z "$cmd" echo "No cmd specified" - echo "Usage: mark [cmd | ] date [cmd args]" - echo "Cmds:" - echo " print [before] [after]: print marks in range [date-before, date-after]" - echo " edit: open the mark store file in an editor or using xdg-open" + __mark_print_usage return 1 end @@ -134,6 +138,8 @@ function mark --argument cmd date switch "$cmd" case "print" __mark_print_dates $date $argv[3] $argv[4] + case "--help" "-h" + __mark_print_usage case "edit" "e" set store (__mark_find_store) if test ! -z "$VISUAL" -- cgit v1.2.3