diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-20 13:57:02 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-09-20 13:57:02 +0200 |
commit | f154d3f778214e5cca7f2e6fb9412184b57edf04 (patch) | |
tree | 072ec5bf989c2328944414e7708ba5ae9671a8ed /stow/vim/.vim/ftplugin/sh/snippets/template.txt | |
parent | 26fdb2bcb24881a4c3ab6a1859bdcb9b646aa876 (diff) | |
download | configs-f154d3f778214e5cca7f2e6fb9412184b57edf04.tar.gz configs-f154d3f778214e5cca7f2e6fb9412184b57edf04.zip |
Changes mostly to vim, trying neovim LSP.
Diffstat (limited to 'stow/vim/.vim/ftplugin/sh/snippets/template.txt')
-rw-r--r-- | stow/vim/.vim/ftplugin/sh/snippets/template.txt | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/stow/vim/.vim/ftplugin/sh/snippets/template.txt b/stow/vim/.vim/ftplugin/sh/snippets/template.txt index 64d3a2e..171dcf8 100644 --- a/stow/vim/.vim/ftplugin/sh/snippets/template.txt +++ b/stow/vim/.vim/ftplugin/sh/snippets/template.txt @@ -4,7 +4,15 @@ # # Usage: template.sh [-ac] [-b OPTARG] FILE... -usageMessage="Usage: template.sh [-ac] [-b OPTARG] FILE..." +usageMessage="Usage: ${0} [-ac] [-b OPTARG] FILE..." + +error() { + printf '%s error: %s\n' "$0" "$*" >&2 +} + +errorAndUsage() { + printf '%s error: %s\n%s\n' "$0" "$*" "$usageMessage" >&2 +} # Process options while getopts ':ab:c' opt; do @@ -15,7 +23,7 @@ while getopts ':ab:c' opt; do ;; 'b' ) - echo b $OPTARG + echo b "$OPTARG" ;; 'c' ) @@ -23,11 +31,9 @@ while getopts ':ab:c' opt; do ;; '?' ) - printf "${usageMessage}\n" + printf '%s\n' "$usageMessage" exit 1 esac done -shift $(($OPTIND - 1)) - -<++> +shift $((OPTIND - 1)) |