diff options
| author | Dennis Fink | 2019-08-28 22:43:36 +0200 |
|---|---|---|
| committer | Dennis Fink | 2019-08-28 22:43:36 +0200 |
| commit | 24f7693d02e9932f33653e1eaf254f270e9ccb26 (patch) | |
| tree | bc04be0999117cd48d15aaea631d6f654080c1aa | |
| parent | 702bc013ce0b4c782d6385b9c8042bd26a387425 (diff) | |
| download | patternutils-24f7693d02e9932f33653e1eaf254f270e9ccb26.tar.gz patternutils-24f7693d02e9932f33653e1eaf254f270e9ccb26.zip | |
Make command an argument in patterncfg add as it is required
Diffstat (limited to '')
| -rw-r--r-- | patternutils/commands/patterncfg.py | 9 |
1 files 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' |
