From 24f7693d02e9932f33653e1eaf254f270e9ccb26 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Wed, 28 Aug 2019 22:43:36 +0200 Subject: Make command an argument in patterncfg add as it is required --- patternutils/commands/patterncfg.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py index e2432d6..75272ac 100644 --- a/patternutils/commands/patterncfg.py +++ b/patternutils/commands/patterncfg.py @@ -35,12 +35,11 @@ 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.option('-c', '--command', default=None, type=click.Choice(['pmatch', 'tmv', 'targs']), - help='select the command from which to view the file') +@click.option('-t', '--template-eninge', default=None, type=click.Choice(('python', 'jinja2')), + help='select the template engine to use. Only applicable for tmv and targs') +@click.argument('command', required=True, type=click.Choice(CURRENT_SUPPORTED_PROGRAMS)) @click.argument('name') -def add(file_type: str, command: Optional[str], name: str) -> None: +def add(file_type: str, command: str, name: str) -> None: if command == 'pmatch': fileext = 'regex' -- cgit v1.3.1