-
Notifications
You must be signed in to change notification settings - Fork 2
feat: Prepare For Multi-Command CLI Interface #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prepares the CLI tool for additional commands by introducing a subcommand structure and updating tests accordingly.
- Modified the tests to invoke the new "xml2json" subcommand.
- Added a dedicated module for the xml2json command and integrated it via the commands package.
- Refactored the CLI entrypoint to support a multi-command interface.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
unittests/test_cli.py | Updated test invocations to use the "xml2json" subcommand. |
src/fundamend/commands/xml2json.py | Added the xml2json command implementation for converting XML to JSON. |
src/fundamend/commands/init.py | Created a central commands module that registers the xml2json command. |
src/fundamend/cli.py | Refactored the CLI entrypoint to delegate to the new commands module. |
print(f"Successfully converted {xml_file_path} file to JSON {json_file_path}") | ||
return json_file_path | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider replacing print() with typer.echo() for consistent CLI output handling which integrates better with Typer's logging and testing facilities.
print(f"Successfully converted {xml_file_path} file to JSON {json_file_path}") | |
return json_file_path | |
typer.echo(f"Successfully converted {xml_file_path} file to JSON {json_file_path}") |
Copilot uses AI. Check for mistakes.
|
||
app = typer.Typer(name="xml2json", help="Convert XML(s) by BDEW to JSON(s)") | ||
app = typer.Typer(name="fundamend", help="CLI tool to work with XML files by BDEW", no_args_is_help=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please adapt the readme accordingly: https://github.com/Hochfrequenz/xml-fundamend-python?tab=readme-ov-file#cli-tool-f%C3%BCr-xml%EF%B8%8Fjson-konvertierung
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fein, bist auf die readme.
fixed README in 629ae3d |
This PR prepares the fundamend cli tool for further commands.
The current xml2json command is now