Skip to content
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

Introduce Command Structure for CLI with New Generate, Info, and Validate Commands #5

Merged
merged 5 commits into from
Aug 16, 2024

Conversation

httpdss
Copy link
Owner

@httpdss httpdss commented Aug 16, 2024

Overview:
This pull request refactors and enhances the command-line interface (CLI) of the project by introducing a structured command system. The main additions include the implementation of new commands—generate, info, and validate—which provide better organization and flexibility for interacting with the project’s structure generation capabilities.

Changes:

  • New Commands:
    • Added GenerateCommand to handle the creation of project structures based on a YAML configuration file.
    • Added InfoCommand to display information about the package.
    • Added ValidateCommand to validate the YAML configuration file used for structure generation.
  • Refactoring:
    • Reorganized the main CLI entry point (struct_module/main.py) to support subcommands using the argparse module.
    • Removed redundant code from the utils.py file, consolidating the responsibilities into the newly created command classes.
    • Updated the setup.py to reflect the new command structure, ensuring that the correct entry points are used.
  • README Updates:
    • Adjusted the documentation to reflect changes in CLI usage, specifically replacing instances of the old command syntax with the new generate subcommand.
  • Test Suite Changes:
    • Removed obsolete test scripts that no longer align with the new command structure, ensuring that the test suite remains relevant to the current codebase.

Justification:
This refactor significantly improves the maintainability and extensibility of the CLI, making it easier to introduce new commands and features in the future. By organizing commands into distinct classes, we enhance the clarity and separation of concerns within the codebase.

Impact:

  • Users will need to update their workflows to use the new generate, info, and validate subcommands.
  • Existing documentation and usage examples are updated to align with the new command structure, ensuring a smooth transition for users.
  • This change lays the groundwork for further enhancements to the CLI, potentially leading to more robust and feature-rich command options in the future.

@httpdss httpdss self-assigned this Aug 16, 2024
@httpdss httpdss changed the title Update struct command usage examples [ENHANCEMENT] Introduce Command Structure for CLI with New Generate, Info, and Validate Commands Aug 16, 2024
@httpdss httpdss changed the title [ENHANCEMENT] Introduce Command Structure for CLI with New Generate, Info, and Validate Commands Introduce Command Structure for CLI with New Generate, Info, and Validate Commands Aug 16, 2024
@httpdss httpdss added the enhancement New feature or request label Aug 16, 2024
@httpdss httpdss marked this pull request as ready for review August 16, 2024 16:03
@httpdss httpdss merged commit 97d93c0 into main Aug 16, 2024
2 checks passed
@httpdss httpdss deleted the sub-commands branch August 16, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant