From 35ef2b97617e6f5ca5c6b59f8a25317c54288094 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Tue, 20 Feb 2018 23:59:53 +0100 Subject: git-branch-list: Add usage output Not using `--help` because Git uses this flag to open a `man` page for the subcommand, and I don't have a `man` page. --- git-branch-list | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/git-branch-list b/git-branch-list index 9a24ccf..e7c1665 100755 --- a/git-branch-list +++ b/git-branch-list @@ -10,6 +10,15 @@ function initialise_database () { fi } +function print_usage () { + cat 1>&2 <<__EOF__ +usage: git branch-list + or: git branch-list save + or: git branch-list drop + or: git branch-list ID +__EOF__ +} + function save_branch () { local branch=$(branch_or_current_branch "$1") @@ -82,6 +91,11 @@ command="$1" initialise_database case "$command" in + -h) + print_usage + + exit 0 + ;; save) save_branch "$2" ;; -- cgit v1.2.3