aboutsummaryrefslogtreecommitdiff
path: root/stow/vim/.vim/ftplugin/sh/snippets/template.txt
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2023-05-08 09:42:29 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2023-05-08 09:42:29 +0200
commit22bbedd73e2b31b5188b38ca3166e146c5f3d431 (patch)
tree64c8d6374dbd98c11230fde263dd64155959bef1 /stow/vim/.vim/ftplugin/sh/snippets/template.txt
parente6bd59a9bc5a6ef70337151c107429088615bd85 (diff)
downloadconfigs-22bbedd73e2b31b5188b38ca3166e146c5f3d431.tar.gz
configs-22bbedd73e2b31b5188b38ca3166e146c5f3d431.zip
Bunch of changes.
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