Uniformly use $TODO_SH to refer to script.
Set $TODO_SH to just be $(basename "$0") at the beginning of the script and use it in all usage messages. This happens to simplify testing because it allows us to refer to the script as "todo.sh" in all output. For general use, if the user has aliased to file to something else, the usage messages will still reflect that alias. Signed-off-by: Emil Sit <sit@emilsit.net>
This commit is contained in:
@@ -14,7 +14,7 @@ todo.sh add notice the daisies > /dev/null
|
||||
test_todo_session 'replace usage' <<EOF
|
||||
>>> todo.sh replace adf asdfa
|
||||
=== 1
|
||||
usage: $(which todo.sh) replace ITEM# "UPDATED ITEM"
|
||||
usage: todo.sh replace ITEM# "UPDATED ITEM"
|
||||
EOF
|
||||
|
||||
test_todo_session 'basic replace' <<EOF
|
||||
|
||||
@@ -6,7 +6,7 @@ test_description='basic priority functionality
|
||||
|
||||
test_todo_session 'priority usage' <<EOF
|
||||
>>> todo.sh pri B B
|
||||
usage: $HOME/bin/todo.sh pri ITEM# PRIORITY
|
||||
usage: todo.sh pri ITEM# PRIORITY
|
||||
note: PRIORITY must be anywhere from A to Z.
|
||||
=== 1
|
||||
EOF
|
||||
|
||||
@@ -92,7 +92,7 @@ TODO: Report file updated.
|
||||
2009-02-13-04:40:00 5 1
|
||||
|
||||
>>> todo.sh append g a
|
||||
usage: $HOME/bin/todo.sh append ITEM# "TEXT TO APPEND"
|
||||
usage: todo.sh append ITEM# "TEXT TO APPEND"
|
||||
=== 1
|
||||
|
||||
>>> todo.sh append 2 and think
|
||||
|
||||
Reference in New Issue
Block a user