Skip to content

Inconsistent behaviour on passing invalid argument #1120

Closed
@kulkarnipradnyas

Description

@kulkarnipradnyas
@Command(command = "activate", group = "Activate/Deactivate Commands")
public class ActivationCommand {
    @Command(command = "test", description = "test")
    public void activateTest(
            @Option(longNames = "id", required = true, description = "test ID") Long id,
            @Option(longNames = "name", required = true, description = "test name") String name
            ){
        System.out.println("Activating test with id: " + id+ name);
    }
}

For the above code, I am getting the below inconsistent result. When an invalid argument is passed as a first argument then the shell throws an error log but when it is passed at the end it just ignores that. It should throw an error log on both cases.

Screenshot 2024-08-16 at 1 04 54 PM Screenshot 2024-08-16 at 1 05 40 PM

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions