aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/sh/snippets/template.txt
diff options
context:
space:
mode:
Diffstat (limited to 'stow/vim/.vim/ftplugin/sh/snippets/template.txt')
-rw-r--r--stow/vim/.vim/ftplugin/sh/snippets/template.txt10
1 files changed, 6 insertions, 4 deletions
diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt
index 171dcf8..8b257fe 100644
--- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt
+++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt
@@ -4,14 +4,16 @@
#
# Usage: template.sh [-ac] [-b OPTARG] FILE...
-usageMessage="Usage: ${0} [-ac] [-b OPTARG] FILE..."
+scriptName="${0##*/}"
+
+usageMessage="Usage: ${scriptName} [-ac] [-b OPTARG] FILE..."
error() {
- printf '%s error: %s\n' "$0" "$*" >&2
+ printf '%s error: %s\n' "$scriptName" "$*" >&2
}
errorAndUsage() {
- printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2
+ printf '%s error: %s\n%s\n' "$scriptName" "$*" "$usageMessage" >&2
}
# Process options
@@ -31,7 +33,7 @@ while getopts ':ab:c' opt; do
;;
'?' )
- printf '%s\n' "$usageMessage"
+ printf '%s\n' "$usageMessage" >&2
exit 1
esac