Module batteries

Source
Available on crate feature batteries only.
Expand description

§Batteries included - helpful parsers that use only public API

bpaf comes with a few extra functions that use only public API in their implementation. You might find them useful either for your code or as an inspiration source

To use anything in this module you need to enable batteries cargo feature.

Examples contain combinatoric usage, for derive usage you should create a parser function and use external annotation.

Functions§

cargo_helper
Strip a command name if present at the front when used as a cargo command
get_usage
Get usage for a parser
toggle_flag
Pick last passed value between two different flags
verbose_and_quiet_by_number
--verbose and --quiet flags with results encoded as number
verbose_by_slice
--verbose and --quiet flags with results choosen from a slice of values