From 3e763e9e6c9c07398df10510b11e1167f755d764 Mon Sep 17 00:00:00 2001 From: Darko Poljak Date: Wed, 7 Dec 2016 18:36:19 +0100 Subject: [PATCH] list -> set for beta commands and args --- cdist/argparse.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cdist/argparse.py b/cdist/argparse.py index cef3dd5f..04f6e6a4 100644 --- a/cdist/argparse.py +++ b/cdist/argparse.py @@ -6,11 +6,11 @@ import logging import collections -# list of beta sub-commands -BETA_COMMANDS = ['install', ] -# list of beta arguments for sub-commands +# set of beta sub-commands +BETA_COMMANDS = set(('install', )) +# set of beta arguments for sub-commands BETA_ARGS = { - 'config': ['jobs', ], + 'config': set(('jobs', )), } EPILOG = "Get cdist at http://www.nico.schottelius.org/software/cdist/" # Parser others can reuse @@ -27,8 +27,7 @@ _verbosity_level = collections.defaultdict( def add_beta_command(cmd): - if cmd not in BETA_COMMANDS: - BETA_COMMANDS.append(cmd) + BETA_COMMANDS.add(cmd) def add_beta_arg(cmd, arg): @@ -36,7 +35,7 @@ def add_beta_arg(cmd, arg): if arg not in BETA_ARGS[cmd]: BETA_ARGS[cmd].append(arg) else: - BETA_ARGS[cmd] = [arg, ] + BETA_ARGS[cmd] = set((arg, )) def check_beta(args_dict):