aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2016-07-21 18:05:02 -0400
committerTeddy Wing2016-07-21 18:05:02 -0400
commit48bd4895c9ed2d76be4cd46b12b00a37cf069f3d (patch)
treeb3e4d98a53dcbc807e29e13744fbacf91e64aa33
parent6a49faba8d13bcec7a6020f2413dac99008c89e4 (diff)
downloadqcd-48bd4895c9ed2d76be4cd46b12b00a37cf069f3d.tar.bz2
qcd: Update usage output
Going for documentation-driven programming. The new usage draft shows how the new version of the command should be called, what options it takes, and in essence what it should be able to do.
-rwxr-xr-xqcd18
1 files changed, 17 insertions, 1 deletions
diff --git a/qcd b/qcd
index 15f9fbf..4cacfba 100755
--- a/qcd
+++ b/qcd
@@ -6,9 +6,25 @@ QCD_CONFIG_DIR=${QCD_CONFIG_DIR:-"${XDG_CONFIG_HOME}/qcd"}
QCD_DATABASE_FILE=${QCD_DATABASE_FILE:-"${QCD_CONFIG_DIR}/database"}
+function print_usage () {
+ cat 1>&2 <<__EOF__
+Usage:
+ qcd SHORTCUT
+ qcd -acrh SHORTCUT [PATH]
+
+ The first call changes to the directory specified by SHORTCUT.
+ The second allows manipulation of the shortcut database.
+
+ -a Add a new shortcut pointing to PATH
+ -c Change an existing shortcut to PATH
+ -r Remove SHORTCUT
+ -h Display this help
+__EOF__
+}
+
function qcd () {
if [[ $# < 1 ]]; then
- echo 'Usage: qcd SHORTCUT' 1>&2
+ print_usage
return
fi