summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Fink2019-08-28 20:09:27 +0200
committerDennis Fink2019-08-28 20:09:27 +0200
commit9600644e9f2c2dddd7b982db3cb128708054ceb8 (patch)
tree9931705c801bd164f867396ec5d150a6cecd3576
parent7ac2c9f056927312645509d236585d4958805621 (diff)
downloadpatternutils-9600644e9f2c2dddd7b982db3cb128708054ceb8.tar.gz
patternutils-9600644e9f2c2dddd7b982db3cb128708054ceb8.zip
Use correct type annotations
Diffstat (limited to '')
-rw-r--r--patternutils/commands/patterncfg.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py
index 7c930da..01e53fc 100644
--- a/patternutils/commands/patterncfg.py
+++ b/patternutils/commands/patterncfg.py
@@ -1,6 +1,8 @@
import os
import os.path
+from typing import Optional
+
import click
from .. import config
@@ -31,11 +33,8 @@ def list() -> None:
@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,
- command: str,
- name: str,
-) -> None:
+def add(file_type: str, command: Optional[str], name: str) -> None:
+
if command == 'pmatch':
fileext = 'regex'
else:
@@ -51,7 +50,7 @@ def add(
@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:
+def remove(command: Optional[str], name: str) -> None:
files = config.find_templates(name, command)
try:
os.remove(files[0])