aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-01-27 17:48:47 +0100
committerTeddy Wing2018-01-27 17:48:47 +0100
commit1c5416f04dc6f4b6c98f6007ca3410b8ec30c8e3 (patch)
tree633a3bc70b03e83ed9f45dd999a886be833a6f18
parentc99f17eb0186b3daad5d43885c654520a95daa9a (diff)
downloadharvester-1c5416f04dc6f4b6c98f6007ca3410b8ec30c8e3.tar.bz2
harvester: Print usage on `--help`
-rwxr-xr-xharvester17
1 files changed, 17 insertions, 0 deletions
diff --git a/harvester b/harvester
index 2641fa8..8f10c4d 100755
--- a/harvester
+++ b/harvester
@@ -1,5 +1,19 @@
#!/bin/bash
+function print_usage () {
+ cat 1>&2 <<__EOF__
+Usage: harvester [<flags>]
+
+Flags:
+ --help Show context-sensitive help.
+ -p, --project=PROJECT Project alias.
+ -t, --time=7 Time spent working on project.
+ -d, --date=DATE Date when work was done (e.g. 2017-01-31).
+ -m, --description=DESCRIPTION Description of work.
+ --list-modules List project sprints with IDs.
+__EOF__
+}
+
function main () {
local project=''
local time=''
@@ -64,6 +78,9 @@ function main () {
continue
;;
--help)
+ print_usage
+
+ return 0
;;
esac
done