Check for incompatible CLI arguments
See original GitHub issueIntroduction
This bounty request is geared towards improving the overall user experience of interacting with the Kernel through the command line options. We are constantly looking to improve and enhance features that will accelerate the development for Aion users.
Current situation
The current CLI implementation provides correct behavior by ignoring errors the user may make in selecting options that are incompatible with one another. When incompatible options are provided, only one of the options will be executed. The option that will be executed depends on the functionality ordering inside the class implementation, not on the order of the given arguments. This situation may lead some users to be puzzled by the execution behavior and can be remedied by printing warning messages in case of incompatible arguments as described below.
Task Description
- Analyse the method
callfrom the classCli.javato determine which combinations of command line arguments are incompatible. - Add a new method
checkArguments(Arguments givenOptions)to the classCli.javathat should be called after the command line parser call where the program arguments are checked and a warning message is printed signaling that incompatible options were given. - Example:
- The current functionality allows only one of the account options to be executed by a program call. The option to be executed depends on the ordering inside the class, not on the order of the given arguments. Therefore if a user runs the command
./aion.sh -a list -a createthe list accounts option will be ignored and the program will proceed to creating a new account. The new functionality introduced here should ensure that a meaningful message is printed for the user before the create account functionality is triggered. The message for this task would be: The given arguments «-a list» and «-a create» require incompatible tasks. Only «-a create» will be executed.
- The current functionality allows only one of the account options to be executed by a program call. The option to be executed depends on the ordering inside the class, not on the order of the given arguments. Therefore if a user runs the command
- The functionality must be accompanied by unit tests for the
checkArgumentsmethod that provide full coverage of the method and illustrate how it handles varying numbers of incompatible options.
Acceptance Criteria
- The code implements the targets described above.
- The code is well documented and fully covered by unit tests.
- The code is compliant with Aion’s code conventions.
- The code gets merged into the main code repository.
Required Skill
Users must have the following skills and experience:
- Java software development
- Debugging and unit testing
Guidance
Details regarding this issue can be requested in comments. Further technical support is available through Gitter.
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (12 by maintainers)

Top Related StackOverflow Question
Seems like PR is merged @AlexandraRoatis.
The work for this bounty has been completed and merged for this issue.