From 5172bdae5751c9e2160a2d41700fcba0a95c6b6f Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Fri, 9 Oct 2015 17:40:06 +0200 Subject: [PATCH] Updated manage_translations script --- scripts/manage_translations.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/manage_translations.py b/scripts/manage_translations.py index 0063be52ad3..df1545a0206 100644 --- a/scripts/manage_translations.py +++ b/scripts/manage_translations.py @@ -168,14 +168,11 @@ if __name__ == "__main__": RUNABLE_SCRIPTS = ('update_catalogs', 'lang_stats', 'fetch') parser = ArgumentParser() - parser.add_argument('cmd', nargs=1) + parser.add_argument('cmd', nargs=1, choices=RUNABLE_SCRIPTS) parser.add_argument("-r", "--resources", action='append', help="limit operation to the specified resources") parser.add_argument("-l", "--languages", action='append', help="limit operation to the specified languages") options = parser.parse_args() - if options.cmd[0] in RUNABLE_SCRIPTS: - eval(options.cmd[0])(options.resources, options.languages) - else: - print("Available commands are: %s" % ", ".join(RUNABLE_SCRIPTS)) + eval(options.cmd[0])(options.resources, options.languages)