aboutsummaryrefslogtreecommitdiff
path: root/src/wrappers/getopts.sh
blob: 263263c07b5f18650f92102b408eebf35e4b10a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
if [ -z "$SYNOPSIS" ]; then
    SYNOPSIS="[-h] [input_file]"
    [ -n "$THIS_NARG" ] || SYNOPSIS="${SYNOPSIS}..."
fi

while getopts h opt; do
    case $opt in
    h|?) usage "$SYNOPSIS"; exit 2 ;;
    esac
done

shift $(($OPTIND - 1))