Skip to content

Default option int value is ignored (in 4.0.1) #1314

@georgmittendorfer

Description

@georgmittendorfer

Description

Specifying a default value for an int option does not work.

Current Behavior

@Option(longName = "...", description = "...", defaultValue = "25") @Positive int someOption

Running a command without specifying the option results in

The following constraints were not met:
	--someOption: must be greater than 0

(Removing the @Positive and manually checking the value confirms that it is 0.)

Wanted behavior

Default value 25 should be set if the option is not specified.

System Information

Linux
Version: Spring Shell 4.0.1
Interactive shell mode

This did work with previous versions, at least with 3.x.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions