Skip to content

Commit e1a1da3

Browse files
Update version to 2.0.2 and modify CLI argument handling
- Bumped the project version to 2.0.2 in pyproject.toml. - Changed the subparsers requirement in the CLI to allow for no command, and added a help message for users when no arguments are provided.
1 parent 33c0964 commit e1a1da3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "Gen3SchemaDev"
3-
version = "2.0.1"
3+
version = "2.0.2"
44
description = "Tool for data modelling in Gen3"
55
authors = [
66
{name = "JoshuaHarris391",email = "[email protected]"}

src/gen3schemadev/cli.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,12 @@ def main():
4747
action="store_true",
4848
help="Show version and exit"
4949
)
50-
# Subparsers are now required, ensuring a command is always run
51-
subparsers = parser.add_subparsers(dest="command", required=True)
50+
subparsers = parser.add_subparsers(dest="command", required=False)
51+
52+
# Print help and exit if no arguments are provided
53+
if len(sys.argv) == 1:
54+
parser.print_help(sys.stderr)
55+
sys.exit(0)
5256

5357
# Create 'generate' subcommand
5458
generate_parser = subparsers.add_parser(

0 commit comments

Comments
 (0)