summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2019-08-29 02:47:59 +0200
committerDennis Fink2019-08-29 02:47:59 +0200
commit93892a4b1a4f4b00d58212585957d260f195a1a9 (patch)
treeaf3138ee31e86eb3b639317e0069f34485fc6c79
parentff0a9ca4efefc2593345427f959b6d3df70882f6 (diff)
downloadpatternutils-93892a4b1a4f4b00d58212585957d260f195a1a9.tar.gz
patternutils-93892a4b1a4f4b00d58212585957d260f195a1a9.zip
Fix patterncfg add
Diffstat (limited to '')
-rw-r--r--patternutils/commands/patterncfg.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py
index 4b29dfd..3cb7067 100644
--- a/patternutils/commands/patterncfg.py
+++ b/patternutils/commands/patterncfg.py
@@ -35,19 +35,19 @@ def list() -> None:
@patterncfg.command(name='add', help='add new template file')
-@click.option('-t', '--template-eninge', default=None, type=click.Choice(('python', 'jinja2')),
+@click.option('-t', '--template-engine', 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: str, name: str) -> None:
+def add(template_engine: Optional[str], command: str, name: str) -> None:
if command == 'pmatch':
fileext = 'regex'
else:
- if file_type not in ('python', 'jinja2'):
+ if template_engine not in ('python', 'jinja2'):
fileext = 'python'
else:
- fileext = file_type
+ fileext = template_engine
filename = os.path.join(config.CONFIG_PATH, command, '{}.{}'.format(name, fileext))
click.edit(filename=filename)