How it works...

Flagsets can be used to set up independent lists of expected arguments, usage strings, and more. The developer is required to perform validation on a number of arguments, parsing in the right subset of arguments to commands and defining usage strings. This can be error-prone and requires a lot of iteration to get completely right.

The flag package makes parsing arguments much easier and includes convenience methods to get the number of flags, arguments, and more. This recipe demonstrates basic ways to construct a complex command-line application using arguments, including a package-level configuration, required positional arguments, multi-level command usage, and how to split these things into multiple files or packages if required.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.45.162