Skip to content

Large refactor of addParamter methods, Extended input error handling#37

Merged
AbUndMax merged 17 commits intomainfrom
refactor-addParamter-methods
Oct 23, 2024
Merged

Large refactor of addParamter methods, Extended input error handling#37
AbUndMax merged 17 commits intomainfrom
refactor-addParamter-methods

Conversation

@AbUndMax
Copy link
Copy Markdown
Owner

No description provided.

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.
@AbUndMax AbUndMax linked an issue Oct 23, 2024 that may be closed by this pull request
@AbUndMax AbUndMax merged commit a61280e into main Oct 23, 2024
@AbUndMax AbUndMax deleted the refactor-addParamter-methods branch October 23, 2024 13:08
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.

Refactor addParamter Methods

1 participant