Module bpaf::_documentation::_2_howto
source · Expand description
Parsing cookbook
While bpaf
’s design tries to cover most common use cases, mostly
posix conventions,
it can also handle some more unusual requirements. It might come at a cost of having to write
more code, more confusing error messages or worse performance, but it will get the job done.
find(1)
:find -exec commands -flags terminated by \;
dd(1)
:dd if=/dev/zero of=/dev/null bs=1000
Xorg(1)
:Xorg +xinerama +extension name
- Command chaining - Lets you do things like
setup.py sdist bdist
: command chaining - Multi-value arguments:
--foo ARG1 ARG2 ARG3
- Structure groups:
--foo --foo-1 ARG1 --foo-2 ARG2 --foo-3 ARG3
- Multi-value arguments with optional flags:
--foo ARG1 --flag --inner ARG2
- Skipping optional positional items if parsing or validation fails
- Implementing cargo commands
- Numeric flags - compression levels like in zip