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