aboutsummaryrefslogtreecommitdiff
path: root/.local/templates/sh
blob: ff7bc6d967c5ab0b0d600d91d576b10ae43ce44f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#! /usr/bin/env sh

main()
{
	# Handle opts
	opts "$@"
	shift "$OPTS"
	unset "$OPTS"

	# Show help
	[ "$OPT_HELP_ONLY" ] && usage && exit 0

	# TODO: Write actual program
}

opts()
{
	OPTS=0

	while getopts ":h" opt
	do
		case "$opt" in
			h) OPT_HELP_ONLY=1
			*)
				printf "Invalid option passed: %s\n" "$OPTARG" >&2
				;;
		esac
	done

	unset opt
}

usage()
{
	cat <<EOF
Usage:
	$(basename "$0") -h

Nondescript

Options:
	-h  Show this help text and exit.
EOF
}

main "$@"