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

Migrate CLI Argument Parsing to Clap #27

Closed
wants to merge 2 commits into from
Closed

Conversation

SpiralOutDotEu
Copy link
Owner

This Pull Request introduces a migration of the CLI argument parsing to use the Clap library. The motivation behind this migration is to enhance the CLI's usability and maintainability, providing a structured and extensible approach to handling command-line arguments and subcommands.

Key Changes:

  • Implemented a Cli struct and a SubCommand enum to represent the available command-line arguments and subcommands in a structured manner.
  • Updated the main function to use Clap for parsing command-line arguments and dispatching subcommands.
  • Replaced manual argument parsing with Clap's automatic parsing, streamlining the argument handling process.
  • Improved error messages and help output by leveraging Clap's built-in functionalities.

Benefits:

  • Usability: Users now have access to more informative help messages and a clearer command-line interface.
  • Maintainability: The new structured approach makes the code easier to read, understand, and extend with new features in the future.
  • Error Handling: Better error handling with clear error messages when incorrect arguments or subcommands are used.

This migration alters the way command-line arguments are parsed and handled, marking a significant improvement in the CLI's usability and code maintainability. Users now have access to more informative help messages and a clearer command-line interface.

Migrate the CLI argument parsing to use the clap library, enhancing the CLI's usability and maintainability. This change introduces a structured way of handling command-line arguments and subcommands, making it easier to extend the CLI with new features in the future.  Additionally, this migration facilitates better error handling and provides users with more informative help messages.

 - Implement `Cli` struct and `SubCommand` enum for structured argument parsing
 - Update `main` function to use clap for argument handling
 - Replace manual argument parsing with clap's automatic parsing
 - Improve error messages and help output by leveraging clap's built-in functionalities
@SpiralOutDotEu
Copy link
Owner Author

It has conflicts

@SpiralOutDotEu SpiralOutDotEu deleted the feature/clap branch October 29, 2023 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant