Command Tree’s documentation¶
Summary¶
The command-tree is a lightweight framework to build multi level command line interfaces by using the python builtin argparse module.
- The main objectives are:
- Full
argparse.ArgumentParser
compatibility. - Use as litle as possible code to build the tree, but preserve the argparse flexibiltiy.
- The class and function structure must looks as the cli tree.
- Decorators, decorators everywhere. We love decorators, so we use as often as possible.
- Full
Usage¶
To understand how to use it see this example first: Basic example. This page contains an example implemented in 2 ways: one with argparse and one with command-tree.
There is a page where we dissected the basic command-tree example and add a lot of comment to explains the code: Basic example with a lot of comments
Config¶
Some very cool extra features can be configured via the Config class. For further information see command_tree.config.Config
.
For a very simple example see Basic config example.