|
1 | 1 | #!/bin/bash |
2 | 2 | # -*- tab-width: 4; encoding: utf-8; -*- |
3 | 3 | # |
4 | | -## @file |
5 | | -## @author Damien Nadé <bash-argsparse@livna.org> |
6 | | -## @brief Bash Argsparse Library |
7 | | -## @copyright WTFPLv2 |
8 | | -## @version 1.8 |
9 | | -# |
10 | 4 | ######### |
11 | 5 | # License: |
12 | 6 | # |
|
26 | 20 | # |
27 | 21 | ######### |
28 | 22 | # |
| 23 | +## @file |
| 24 | +## @author Damien Nadé <bash-argsparse@livna.org> |
| 25 | +## @copyright WTFPLv2 |
| 26 | +## @version 1.8 |
| 27 | +## @brief Bash Argsparse Library |
29 | 28 | ## @details |
30 | 29 | ## @par URL |
31 | 30 | ## https://github.com/Anvil/bash-argsparse @n |
32 | | -# |
| 31 | +## |
33 | 32 | ## @par Purpose |
34 | | -# |
| 33 | +## |
35 | 34 | ## To replace the option-parsing and usage-describing functions |
36 | 35 | ## commonly rewritten in all scripts. |
37 | 36 | ## |
|
42 | 41 | ## The extglob shell option will be enabled and posix mode will be |
43 | 42 | ## disabled when loading the library. Changing those settings |
44 | 43 | ## afterwards will make the library execution fail. |
45 | | -# |
| 44 | +## |
46 | 45 | ## @par Usage |
47 | 46 | ## Use the argsparse_use_option() function to declare your options with |
48 | 47 | ## their single letter counterparts, along with their description. |
|
72 | 71 | ## What is referred later as "option" or "option name" (or even "long |
73 | 72 | ## option name") is the optstring without the ':' and '=' characters. |
74 | 73 | ## |
75 | | -### |
| 74 | +## |
76 | 75 | ## |
77 | 76 | ## @par Options may have properties. |
78 | 77 | ## |
|
171 | 170 | ## argsparse_has_option_property() function. |
172 | 171 | ## @code argsparse_has_option_property <option> <property> @endcode |
173 | 172 | ## |
174 | | -# |
| 173 | +## |
175 | 174 | ## @par Parsing positionnal parameters |
176 | 175 | ## After the options are declared, invoke the function |
177 | 176 | ## argsparse_parse_options() with the all script parameters. This will |
|
201 | 200 | ## e.g: |
202 | 201 | ## @code argsparse_is_option_set "long-option-name" @endcode |
203 | 202 | ## |
204 | | -### |
| 203 | +## |
205 | 204 | ## @par The "usage()" function |
206 | 205 | ## If a 'usage' function is defined, and shall |
207 | 206 | ## argsparse_parse_options() return with non-zero status, 'usage' will |
|
211 | 210 | ## This library automatically defines a default 'usage' function, |
212 | 211 | ## which may be removed or overridden by the sourcing program |
213 | 212 | ## afterwards. |
214 | | -# |
| 213 | +## |
215 | 214 | ## |
216 | 215 | ## @par Value setting internal logic |
217 | 216 | ## During option parsing, for every option of the form '--optionname' |
|
248 | 247 | ## All the functions will return with an error (usually a return code |
249 | 248 | ## of 1) if called with a wrong number of parameters, and return with |
250 | 249 | ## 0 if everything went fine. |
251 | | -# |
| 250 | +## |
252 | 251 | ## @defgroup ArgsparseUsage Calling program usage description message. |
253 | 252 | ## @defgroup ArgsparseOptionSetter Setting options values. |
254 | 253 | ## @defgroup ArgsparseProperty Options properties handling. |
|
0 commit comments