about summary refs log tree commit diff stats
path: root/snippets/sh-mode/getopts
blob: 8f6fc395ca14b06fe29174028fd45dd502eed3ea (plain)
1
2
3
4
5
6
7
8
9
10
# -*- mode: snippet -*-
# name: getopts
# key: getopts
# --
while getopts ${1:h} opt; do
    case "$opt" in
        $0
    esac
done
shift $(( OPTIND -1 ))