From 104af9d1cd7fc3d8ef41a373e757516d0da88409 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sun, 8 Apr 2018 01:49:07 +0200 Subject: Normalize patterncfg subcommands --- patternutils/commands/patterncfg.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py index abc1e09..ea51f5c 100644 --- a/patternutils/commands/patterncfg.py +++ b/patternutils/commands/patterncfg.py @@ -22,7 +22,8 @@ def list() -> None: @patterncfg.command(name='add', help='add new template file') @click.option('-t', '--file-type', default='regex', type=click.Choice(['regex', 'python', 'jinja2']), help='select the file type to use') -@click.argument('command', type=click.Choice(['pmatch', 'tmv', 'targs'])) +@click.option('-c', '--command', default=None, type=click.Choice(['pmatch', 'tmv', 'targs']), + help='select the command from which to view the file') @click.argument('name') def add( file_type: str, @@ -41,7 +42,8 @@ def add( @patterncfg.command(name='remove', help='remove template file') -@click.argument('command', type=click.Choice(['pmatch', 'tmv', 'targs'])) +@click.option('-c', '--command', default=None, type=click.Choice(['pmatch', 'tmv', 'targs']), + help='select the command from which to view the file') @click.argument('name') def remove(command: str, name: str) -> None: files = config.find_templates(name, command) -- cgit v1.3.1