add zsh.snippets, add getopts snippet
This commit is contained in:
parent
66e85088ed
commit
d6c2ef8cfe
18
vim/UltiSnips/zsh.snippets
Normal file
18
vim/UltiSnips/zsh.snippets
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
snippet getopts "Deal with shell parameters" b
|
||||||
|
BOOL=false
|
||||||
|
VAVLUE=''
|
||||||
|
while getopts ":bv:" o; do
|
||||||
|
case "${o}" in
|
||||||
|
b)
|
||||||
|
BOOL=true
|
||||||
|
;;
|
||||||
|
v)
|
||||||
|
VALUE=${OPTARG}
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $1 [-b] [-v VALUE]"
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
endsnippet
|
Loading…
Reference in New Issue
Block a user