New Plugin Architecture: introduce CLICmd
The CLICmd, is a base class for plugins that want to add commands
to the Avocado command line application. These commands should be
given by a user right after the command line application itself, as
it's common practice in most CLI tools.
This class has minimal functionality (some in the configure method),
and its main goal is to define the interface that plugin developers
should follow.
The only mandatory steps for "CLICmd" plugins are a name, and the
`run` method. `configure` will, by default register the command
with Avocado command line parser.
By doing just that, the new command is visible on the Avocado command
line application. So, if a plugin named "foo" would introduce a
command with the same name (ideally, for consistency) it would be
called with:
$ avocado foo
And it's help message would be visible with:
$ avocado foo --help
Other command line options to a given introduced command can be added
by writing a custom `configure` method.
Signed-off-by: NCleber Rosa <crosa@redhat.com>
Showing
avocado/plugins/base.py
0 → 100644
想要评论请 注册 或 登录