summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--patternutils/commands/patterncfg.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/patternutils/commands/patterncfg.py b/patternutils/commands/patterncfg.py
index aace2ba..231940c 100644
--- a/patternutils/commands/patterncfg.py
+++ b/patternutils/commands/patterncfg.py
@@ -8,6 +8,9 @@ import click
from .. import config
+CURRENT_SUPPORTED_PROGRAMS = ('pmatch', 'tmv', 'targs')
+
+
@click.group(context_settings={'help_option_names': ('-h', '--help', '-?')})
def patterncfg() -> None:
pass
@@ -15,7 +18,7 @@ def patterncfg() -> None:
@patterncfg.command(name='init', help='initialize config folders')
def init() -> None:
- for dir in ['pmatch', 'tmv', 'targs']:
+ for dir in CURRENT_SUPPORTED_PROGRAMS:
os.makedirs(os.path.join(config.CONFIG_PATH, dir), exist_ok=True)
@@ -48,7 +51,7 @@ def add(file_type: str, command: Optional[str], name: str) -> None:
@patterncfg.command(name='remove', help='remove template file')
-@click.option('-c', '--command', default=None, type=click.Choice(['pmatch', 'tmv', 'targs']),
+@click.option('-c', '--command', default=None, type=click.Choice(CURRENT_SUPPORTED_PROGRAMS),
help='select the command from which to view the file')
@click.argument('name')
def remove(command: Optional[str], name: str) -> None:
@@ -68,7 +71,7 @@ def remove(command: Optional[str], name: str) -> None:
@patterncfg.command(name='view', help='view template file')
-@click.option('-c', '--command', default=None, type=click.Choice(['pmatch', 'tmv', 'targs']),
+@click.option('-c', '--command', default=None, type=click.Choice(CURRENT_SUPPORTED_PROGRAMS),
help='select the command from which to view the file')
@click.argument('name')
def view(name: str, command: str) -> None: