From 48bd4895c9ed2d76be4cd46b12b00a37cf069f3d Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 21 Jul 2016 18:05:02 -0400 Subject: 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. --- qcd | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3