Skip to content

Commit 9fd5739

Browse files
committed
Added short flags
1 parent 621cb11 commit 9fd5739

4 files changed

Lines changed: 17 additions & 17 deletions

File tree

remove-json-keys/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "remove-json-keys"
7-
version = "0.0.17"
7+
version = "0.0.18"
88
description = "Remove key/value pairs from json_dir/**/*.json."
99
authors = [{name = "Adam Lui", email = "adam@kudoai.com"}]
1010
license = "MIT"

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ def cli():
1111
description="Remove key/value pairs from JSON files",
1212
add_help=False # disable default --help arg to re-create last
1313
)
14-
argp.add_argument('--remove-keys', type=str, help='Keys to remove (e.g. "appName,author")')
15-
argp.add_argument('--json-dir', '--json-folder',
14+
argp.add_argument('-k', '--remove-keys', type=str, help='Keys to remove (e.g. "appName,author")')
15+
argp.add_argument('-d', '--json-dir', '--json-folder',
1616
type=str, help='Name of the folder containing JSON files (default: "_locales")')
17-
argp.add_argument('--no-wizard', '--skip-wizard',
17+
argp.add_argument('-W', '--no-wizard', '--skip-wizard',
1818
action='store_true', default=None, help='Skip interactive prompts during start-up')
1919
argp.add_argument('-h', '--help', action='help', help="Show help screen")
2020
cli.config=sns()

translate-messages/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ _Note: Any messages.json in the [`chrome.i18n`](https://developer.chrome.com/doc
3939

4040
Options can be set by using command-line arguments:
4141

42-
| Option | Description | Example
43-
| ----------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------
44-
| `--locales-dir` | Name of the folder containing locale files (default: `_locales`) | `--locales-dir=_messages`
45-
| `--target-langs` | Comma-separated list of languages to include (default: all [`supported_locales`][supported-locales]) | `--target-langs=en,es,fr`
46-
| `--exclude-langs` | Comma-separated list of languages to exclude | `--exclude-langs=en,es`
47-
| `--exclude-keys` | Comma-separated list of keys to ignore | `--exclude-keys=appName,author`
48-
| `--init` | Create .translate-msgs.config.json in project root to store defaults |
49-
| `--no-wizard` | Skip interactive prompts during start-up |
50-
| `-h`, `--help` | Show help screen |
42+
| Option | Description | Example
43+
| ---------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------
44+
| `-d`, `--locales-dir` | Name of the folder containing locale files (default: `_locales`) | `--locales-dir=_messages`
45+
| `-t`, `--target-langs` | Comma-separated list of languages to include (default: all [`supported_locales`][supported-locales]) | `--target-langs=en,es,fr`
46+
| `--exclude-langs` | Comma-separated list of languages to exclude | `--exclude-langs=en,es`
47+
| `--exclude-keys` | Comma-separated list of keys to ignore | `--exclude-keys=appName,author`
48+
| `-i`, `--init` | Create .translate-msgs.config.json in project root to store defaults |
49+
| `-W`, `--no-wizard` | Skip interactive prompts during start-up |
50+
| `-h`, `--help` | Show help screen |
5151

5252
[supported-locales]: https://github.com/adamlui/python-utils/blob/translate-messages-1.1.0/translate-messages/src/translate_messages/package_data.json#L11-L16
5353

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def cli(caller_file):
2626
description="Translate en/messages.json (chrome.i18n format) to other locales",
2727
add_help=False # disable default --help arg to re-create last
2828
)
29-
argp.add_argument('--locales-dir', '--locales-folder',
29+
argp.add_argument('-d', '--locales-dir', '--locales-folder',
3030
type=str, help='Name of the folder containing locale files (default: "_locales")')
31-
argp.add_argument('--target-langs', '--target-lang', '--include-langs', '--include-lang',
31+
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)')
3333
argp.add_argument('--exclude-langs', '--exclude-lang', type=str, help='Languages to exclude (e.g. "en,es")')
3434
argp.add_argument('--exclude-keys', '--ignore-keys', type=str, help='Keys to ignore (e.g. "appName,author")')
35-
argp.add_argument('--init', action='store_true', help=f'Create {cli.name}.config.json file to store defaults')
36-
argp.add_argument('--no-wizard', '--skip-wizard',
35+
argp.add_argument('-i', '--init', action='store_true', help=f'Create {cli.name}.config.json file to store defaults')
36+
argp.add_argument('-W', '--no-wizard', '--skip-wizard',
3737
action='store_true', default=None, help='Skip interactive prompts during start-up')
3838
argp.add_argument('-h', '--help', action='help', help="Show help screen")
3939
cli.config.__dict__.update({ key:val for key,val in vars(argp.parse_args()).items() if val is not None })

0 commit comments

Comments
 (0)