`make tlok` outputs "FAIL\n" if the executable wasn't created
[sunny256-utils.git] / Lib / std / sh
blob3497dfc771f821c920e92ea80d3642760c2a9186
1 #!/bin/sh
3 #==============================================================================
4 # STDfilenameDTS
5 # File ID: STDuuidDTS
7 # [Description]
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
13 progname=STDfilenameDTS
14 VERSION=0.0.0
16 opt_help=0
17 opt_quiet=0
18 opt_verbose=0
20 while test -n "$1"; do
21 case "$1" in
22 -h|--help) opt_help=1; shift ;;
23 -q|--quiet) opt_quiet=$(($opt_quiet + 1)); shift ;;
24 -v|--verbose) opt_verbose=$(($opt_verbose + 1)); shift ;;
25 --version) echo $progname $VERSION; exit 0 ;;
26 --) shift; break ;;
28 if printf '%s\n' "$1" | grep -q ^-; then
29 echo "$progname: $1: Unknown option" >&2
30 exit 1
31 else
32 break
34 break ;;
35 esac
36 done
37 opt_verbose=$(($opt_verbose - $opt_quiet))
39 if test "$opt_help" = "1"; then
40 test $opt_verbose -gt 0 && { echo; echo $progname $VERSION; }
41 cat <<END
43 Usage: $progname [options]
45 Options:
47 -h, --help
48 Show this help.
49 -q, --quiet
50 Be more quiet. Can be repeated to increase silence.
51 -v, --verbose
52 Increase level of verbosity. Can be repeated.
53 --version
54 Print version information.
56 END
57 exit 0
60 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :