taurus.cli.common
This module provides the taurus Command Line Interface common options.
It is based on the click module to provide commonly used flags/options. They are used by taurus commands and can be used by plugin to easily extend its functionality.
Example 1: Add custom subcommand script:
import click
import taurus.cli.common
@click.command("bar")
@taurus.cli.common.poll_period
@taurus.cli.common.default_formatter
@taurus.cli.common.window_name("Super Bar")
def bar(poll_period, default_formatter, window_name):
...
if __name__ == '__main__':
bar()
Example 2: Add custom subcommands’ group script:
import click
import taurus.cli.common
@click.group("foo")
def foo():
pass
@foo.command('cmd1')
@taurus.cli.common.models
@taurus.cli.common.config_file
@taurus.cli.common.window_name("Super Foo (cmd1)")
def cmd1(models, config_file, window_name):
...
@foo.command('trend')
@taurus.cli.common.model
@taurus.cli.common.serial_mode
@taurus.cli.common.poll_period
@taurus.cli.common.default_formatter
def cmd2(model, serial_mode, poll_period, default_formatter):
...
if __name__ == '__main__':
foo()
Functions
- config_file(f: FC) FC
- default_formatter(f: FC) FC
- demo(f: FC) FC
- list_alternatives(f: FC) FC
- log_level(f: FC) FC
- model(f: FC) FC
- models(f: FC) FC
- poll_period(f: FC) FC
- serial_mode(f: FC) FC
- use_alternative(f: FC) FC