You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|--metavar|Usage argument name (if not set use long/short name)|
84
-
|--required|Is required if present|
85
-
86
-
```bash
87
-
args_add_argument [options] -- [name/flags...]
88
-
```
89
-
90
-
#### Examples
91
-
92
-
```bash
93
-
# positional argument
94
-
args_add_argument --help="help of FOO" --dest="FOO" --required -- "FOO"
95
-
# boolean optional argument
96
-
args_add_argument --action="store_true" --help="help of foo" --dest="FOO" -- "-f""--foo"
97
-
# not boolean optional argument
98
-
args_add_argument --action="store_false" --help="help of foo" --dest="FOO" -- "-f""--foo"
99
-
# optional argument
100
-
args_add_argument --help="help of foo" --dest="FOO" -- "-f""--foo"
101
-
```
102
-
103
-
### args_parse_arguments
104
-
105
-
Use after args_add_* functions
106
-
Convert argument strings to objects and assign them as attributes on the ARGS map
107
-
Previous calls to args_add_argument/args_add_bool_option/args_add_reverse_bool_option/args_add_option
108
-
determine exactly what objects are created and how they are assigned
109
-
Execute this with "$@" parameters
110
-
111
-
#### Example
112
-
113
-
```bash
114
-
args_parse_arguments "$@"
69
+
$ ./example/quickstart.sh 42 -p
70
+
'ARG1' argument from dest 42
71
+
'ARG1' argument from map 42
72
+
'--option' option from map 24
73
+
Hello world
74
+
$ ./example/quickstart.sh 42 -p --option 42
75
+
'ARG1' argument from dest 42
76
+
'ARG1' argument from map 42
77
+
'--option' option from map 42
78
+
Hello world
115
79
```
116
80
117
81
## Documentations
118
82
119
-
[docs/global.md](docs/global.md)
120
-
[docs/setter.md](docs/setter.md)
83
+
|Function|Description|
84
+
|---|---|
85
+
|[args_add_argument](docs/functions.md#args_add_argument)|Add a argument|
86
+
|[args_parse_arguments](docs/functions.md#args_parse_arguments)|Convert argument strings to objects and assign them as attributes on the ARGS map|
87
+
|[args_set_description](docs/functions.md#args_set_description)|Set a usage description|
88
+
|[args_set_epilog](docs/functions.md#args_set_epilog)|Set a epilog description|
89
+
|[args_set_usage_width](docs/functions.md#args_set_usage_width)|Set the widths of usage message|
90
+
|[args_set_usage](docs/functions.md#args_set_usage)|Set a full usage message|
91
+
|[args_set_alternative](docs/functions.md#args_set_alternative)|Set alternative mode for [getopt](https://www.man7.org/linux/man-pages/man1/getopt.1.html)|
0 commit comments