1 This folder contains code snippets that can be reused by multiple
2 scripts. A brief description of each file follows.
5 Provides basic output formatting functions with levels 'msg', 'msg2',
6 'warning' and 'error'. The 'msg' amd 'msg2' functions print to stdout
7 and can be silenced by defining 'QUIET'. The 'warning' and 'error'
8 functions print to stderr with the appropriate prefix added to the
12 A getopt replacement to avoids portability issues, in particular the
13 lack of long option name support in the default getopt provided by some
15 Usage: parse_option $SHORT_OPTS $LONG_OPTS "$@"
18 A getopt_long-like parser which portably supports longopts and shortopts
19 with some GNU extensions. It does not allow for options with optional
20 arguments. For both short and long opts, options requiring an argument
21 should be suffixed with a colon. After the first argument containing
22 the short opts, any number of valid long opts may be be passed. The end
23 of the options delimiter must then be added, followed by the user arguments
24 to the calling program.
28 OPT_LONG=('foo' 'bar:' 'baz')
29 if ! parseopts "$OPT_SHORT" "${OPT_LONG[@]}" -- "$@"; then
35 1: parse failure (error message supplied)