# -*- mode: snippet -*- # name: getopt # uuid: # key: getopt # -- ${1:OPT1}="${2:default value}" $0 while getopts "${3:s}" o do case "$o" in $3) $1="$OPTARG";; [?]) usage;; esac done shift $(expr $OPTIND - 1)