Large refactor of addParamter methods, Extended input error handling#37
Merged
Large refactor of addParamter methods, Extended input error handling#37
Conversation
Removed the TestArgsParser.java file to clean up cases. New TestFiles created WIP
Renamed methods for adding parameters to clarify their usage and requirements. Introduced an ArgumentConverter enum to handle argument type conversion, simplifying the logic in the setArgument method.
Updated the help message format to include array parameters, allowing <type[]> notation for String, int, double, boolean, and char arrays. Improved description validation to ensure non-empty descriptions.
Introduce tests for default values and argument overrides in ArgsParser. Refactor existing test method names for clarity and coverage of both cases.
Implement `FlagAlreadyProvidedArgsException` to handle cases where a flag is passed multiple times. This exception is now thrown if a flag is redundantly specified, ensuring argument consistency and avoiding potential errors.
Switched array flag indicators from '[]' to '+' for better clarity and updated help message formatting to reflect this change. Modified mandatory and optional flags to use '(!)' and '(?)' respectively, and adjusted help message alignment for consistency.
Introduced numerous test cases covering various exception scenarios in ArgParser, including unknown flags, missing arguments, and redundant specifications. These tests enhance the robustness and reliability of argument parsing.
Added support for multiple arguments to one flag, detailed new types and methods, and clarified existing descriptions. Updated the examples and help sections to reflect the latest changes in ArgsParser functionalities.
Added support for multiple arguments to one flag, detailed new types and methods, and clarified existing descriptions. Updated the examples and help sections to reflect the latest changes in ArgsParser functionalities.
Replace Sets with LinkedLists for fullFlags and shortFlags to ensure help printout maintains order of Parameter definition. Adjust exception handling and help message generation to accommodate the new collection type.
Implemented multiple unit tests to ensure robust handling of various argument scenarios, including help command, missing parameters, redundant flags, and type validation. These tests enhance the reliability and maintainability of the ArgsParser.
Replaced multiple instances of `args.length` with `argsLength` to enhance readability and performance. Introduced checks for help flag's positions, adding new tests for incorrect help flag placement scenarios.
Reordered and clarified instructions for parameter definitions. Added and corrected examples for array parameters and fixed `--help` flag usage explanations.
Refined the description to highlight ease of parameter handling and removed complex exception handling clause. This clarifies the usage information and improves readability.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.