A tiny command line argument parser with automatic help generation, and argument validation.
- Internally, the arguments are stored inside a Value enum containing three simple types: bool, String, and f64 representing booleans, numbers and text.
- Arguments without the
-or--prefixes are stored inside a Vec "bucket" of VARGS in the given order. This list can be accessed using theget_vargs()function. - Arguments with values are set like:
--arg=value. - Help sections such as description, usage, and examples can be redefined if needed using the
provided functions:
define_help_...(). - The help call is hard coded.
Example
use *;
use ExitCode;
Generated Help
>demo_program --help
A demo for TinyArgs
Help:
Usage: demo_program [OPTION] [PATHS]...
Options:
-h, --help Display this help message
--name=<name> A name of something [Default: test]
-t, --times=<times> How many times [Default: 22]
-v, --version Display version number
Examples:
demo_program --name=test some/path/ - Sets some values