mirror of https://github.com/octoleo/hosts.git
Add comments about option parsing.
This commit is contained in:
parent
647c4329c9
commit
5ee732006d
15
hosts
15
hosts
|
@ -123,6 +123,21 @@ die() {
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# Options
|
# Options
|
||||||
|
#
|
||||||
|
# NOTE: The `getops` builtin command only parses short options and BSD `getopt`
|
||||||
|
# does not support long arguments (GNU `getopt` does), so the most portable
|
||||||
|
# and clear way to parse options is often to just use a `while` loop.
|
||||||
|
#
|
||||||
|
# For a pure bash `getopt` function, try pure-getopt:
|
||||||
|
# https://github.com/agriffis/pure-getopt
|
||||||
|
#
|
||||||
|
# More info:
|
||||||
|
# http://wiki.bash-hackers.org/scripting/posparams
|
||||||
|
# http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
|
||||||
|
# http://stackoverflow.com/a/14203146
|
||||||
|
# http://stackoverflow.com/a/7948533
|
||||||
|
# https://stackoverflow.com/a/12026302
|
||||||
|
# https://stackoverflow.com/a/402410
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
# Get raw options for any commands that expect them.
|
# Get raw options for any commands that expect them.
|
||||||
|
|
Loading…
Reference in New Issue