INNER CODE UNIT · Python
format_commands
jd/pifpaf · pifpaf/__main__.py:151
def format_commands(self, ctx, formatter):
# Same as click.MultiCommand.format_commands except it does not use
# get_command so we don't have to load commands on listing.
rows = []
for subcommand in self.list_commands(ctx):
rows.append((subcommand, 'Run ' + subcommand))
if rows:
with formatter.section('Commands'):
formatter.write_dl(rows)
def _run(self, daemon, plugin, ctx, command, **kwargs):
debug = ctx.obj['debug']
env_prefix = ctx.obj['env_prefix']
global_urls_variable = ctx.obj['global_urls_variable']
driver = plugin(env_prefix=env_prefix,
debug=debug,
**kwargs)