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: click.decorators.FC) click.decorators.FC
default_formatter(f: click.decorators.FC) click.decorators.FC
demo(f: click.decorators.FC) click.decorators.FC
list_alternatives(f: click.decorators.FC) click.decorators.FC
log_level(f: click.decorators.FC) click.decorators.FC
model(f: click.decorators.FC) click.decorators.FC
models(f: click.decorators.FC) click.decorators.FC
poll_period(f: click.decorators.FC) click.decorators.FC
serial_mode(f: click.decorators.FC) click.decorators.FC
use_alternative(f: click.decorators.FC) click.decorators.FC
window_name(default)[source]