Created
May 27, 2020 20:03
-
-
Save jagipson/1a873ff9744ad61627dc04c143c9b540 to your computer and use it in GitHub Desktop.
yas snippet for bash while getopts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: snippet -*- | |
# name: wgetopts | |
# key: wgetopts | |
# ${1:$(mapconcat (lambda (c) (format "%c)\n\t: #TODO: Implement option\n\t;;\n\n" c)) yas-text "")} | |
# -- | |
while getopts ":${1:opts}"; do | |
case opt in | |
${1:$(mapconcat (lambda (c) (format "%c)\n\t: #TODO: Implement option\n\t;;\n\n" c)) (replace-regexp-in-string ":" "" yas-text) "")} | |
*) | |
usage | |
;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment