Auto-generated help screen:
$ julia ./argparse_example1.jl --help
usage: argparse_example_1.jl [--opt1 OPT1] [-o OPT2] [-h] [arg1]
Example 1 for argparse.jl: minimal usage.
positional arguments:
arg1
optional arguments:
--opt1 OPT1
-o, --opt2 OPT2
-h, --help show this help message and exit
A syntax error will produce a message and show the usage line:
$ julia ./argparse_example1.jl --opt1
option --opt1 requires an argument
usage: argparse_example_1.jl [--opt1 OPT1] [-o OPT2] [-h] [arg1]
Example of a successful run:
$ julia ./argparse_example1.jl -o TST
Parsed args:
arg1 => nothing
opt2 => TST
opt1 => nothing
note that if no default is specified, the value will be nothing
.