Skip to content

Commit 3c56c3b

Browse files
committed
Replaced --help tip w/ shorter sentence-cased ver, moved to bottom
1 parent 85fa454 commit 3c56c3b

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

remove-json-keys/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "remove-json-keys"
3-
version = "0.0.8"
3+
version = "0.0.9"
44
description = "Remove key/value pairs from json_dir/**/*.json."
55
authors = [{name = "Adam Lui", email = "adam@kudoai.com"}]
66

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,14 @@ def cli():
77
cli = data.sns.from_dict(data.json.read(os.path.join(os.path.dirname(__file__), '../package-data.json')))
88

99
# Parse CLI args
10-
argp = argparse.ArgumentParser(description='Remove key/value pairs from JSON files')
10+
argp = argparse.ArgumentParser(
11+
description="Remove key/value pairs from JSON files",
12+
add_help=False # disable default --help arg to re-create last
13+
)
1114
argp.add_argument('--remove-keys', type=str, help='Keys to remove (e.g. "appName,author")')
1215
argp.add_argument('--json-dir', type=str, help='Name of folder containing JSON files')
1316
argp.add_argument('--no-wizard', action='store_true', default=None, help='Skip interactive prompts during start-up')
17+
argp.add_argument('-h', '--help', action='help', help="Show help screen")
1418
cli.config=sns()
1519
cli.config.__dict__.update({ key:val for key,val in vars(argp.parse_args()).items() if val is not None })
1620

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ def cli(caller_file):
1616
cli.config = data.sns.from_dict(data.json.read(config_path)) ; break
1717

1818
# Parse CLI args
19-
argp = argparse.ArgumentParser(description='Translate en/messages.json to other locales')
19+
argp = argparse.ArgumentParser(
20+
description="Translate en/messages.json to other locales",
21+
add_help=False # disable default --help arg to re-create last
22+
)
2023
argp.add_argument('--include-langs', type=str, help='Languages to include (e.g. "en,es,fr")')
2124
argp.add_argument('--exclude-langs', type=str, help='Languages to exclude (e.g. "en,es")')
2225
argp.add_argument('--ignore-keys', type=str, help='Keys to ignore (e.g. "appName,author")')
2326
argp.add_argument('--locales-dir', type=str, help='Name of folder containing locales')
2427
argp.add_argument('--init', action='store_true', help=f'Create {cli.name}.config.json file to store defaults')
2528
argp.add_argument('--no-wizard', action='store_true', default=None, help='Skip interactive prompts during start-up')
29+
argp.add_argument('-h', '--help', action='help', help="Show help screen")
2630
cli.config.__dict__.update({ key:val for key,val in vars(argp.parse_args()).items() if val is not None })
2731

2832
# Init cli.config vals

0 commit comments

Comments
 (0)