Skip to content

Commit 3064172

Browse files
committed
Added CLI arg aliases
1 parent 2f0bfa5 commit 3064172

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

  • remove-json-keys/src/remove_json_keys/lib
  • translate-messages/src/translate_messages/lib

remove-json-keys/src/remove_json_keys/lib/init.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@ def cli():
99
# Parse CLI args
1010
argp = argparse.ArgumentParser(
1111
description="Simply remove JSON keys via CLI command",
12-
add_help=False # disable default --help arg to re-create last
12+
add_help=False # disable default --help arg to re-create last
1313
)
1414
argp.add_argument('-d', '--json-dir', '--json-folder',
1515
type=str, help='Name of the folder containing JSON files (default: "_locales")')
16-
argp.add_argument('-k', '--keys', '--remove-keys', type=str, help='Keys to remove (e.g. "appName,author")')
16+
argp.add_argument('-k', '--keys', '--key', '--remove-keys', '--remove-key', '--delete-keys', '--delete-key',
17+
type=str, help='Keys to remove (e.g. "appName,author")')
1718
argp.add_argument('-W', '--no-wizard', '--skip-wizard',
1819
action='store_true', default=None, help='Skip interactive prompts during start-up')
1920
argp.add_argument('-h', '--help', action='help', help="Show help screen")

translate-messages/src/translate_messages/lib/init.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,21 @@ def cli(caller_file):
2424
# Parse CLI args
2525
argp = argparse.ArgumentParser(
2626
description="Translate en/messages.json (chrome.i18n format) to other locales",
27-
add_help=False # disable default --help arg to re-create last
27+
add_help=False # disable default --help arg to re-create last
2828
)
29-
argp.add_argument('-d', '--locales-dir', '--locales-folder',
29+
argp.add_argument('-d', '--locales-dir', '--locales-folder', '--json-dir', '--json-folder',
3030
type=str, help='Name of the folder containing locale files (default: "_locales")')
3131
argp.add_argument('-t', '--target-langs', '--target-lang', '--include-langs', '--include-lang',
3232
type=str, help='Languages to include (e.g. "en,es,fr") (default: all supported locales)')
33-
argp.add_argument('-k', '--keys', '--key', '--include-keys', '--include-key',
33+
argp.add_argument('-k', '--keys', '--key', '--include-keys', '--include-key', '--translate-keys', '--translate-key',
3434
type=str, help='Keys to translate (e.g. "appDesc,err_notFound")')
35-
argp.add_argument('--exclude-langs', '--exclude-lang', type=str, help='Languages to exclude (e.g. "en,es")')
36-
argp.add_argument('--exclude-keys', '--ignore-keys', type=str, help='Keys to ignore (e.g. "appName,author")')
35+
argp.add_argument('--exclude-langs', '--exclude-lang', '--ignore-langs', '--ignore-lang',
36+
type=str, help='Languages to exclude (e.g. "en,es")')
37+
argp.add_argument('--exclude-keys', '--exclude-key', '--ignore-keys', '--ignore-key',
38+
type=str, help='Keys to ignore (e.g. "appName,author")')
3739
argp.add_argument('-i', '--init', action='store_true', help=f'Create {cli.name}.config.json file to store defaults')
38-
argp.add_argument('-f', '--force', action='store_true', help='Force overwrite existing config file when using --init')
40+
argp.add_argument('-f', '--force', '--overwrite',
41+
action='store_true', help='Force overwrite existing config file when using --init')
3942
argp.add_argument('-W', '--no-wizard', '--skip-wizard',
4043
action='store_true', default=None, help='Skip interactive prompts during start-up')
4144
argp.add_argument('-h', '--help', action='help', help="Show help screen")

0 commit comments

Comments
 (0)