Skip to content

Improve default parser to accept boolean options without values #1304

@fmbenhassine

Description

@fmbenhassine

This was initially reported by @ThomasVitale in #1262


Furthermore, when providing the option at execution time, a value is also required. This bit is mentioned in the docs, but it would be great to highlight that in the migration guide as a breaking change since it completely change the user experience.

It's common for CLIs to pass boolean options to a command without a value, meaning it's "true". Any chance the previous behaviour could be restored? This breaking change doesn't affect only developers when upgrading to 4.0, but also all users of CLIs implemented with Spring Shell, having to change commands like:

mycli test --clean

to:

mycli test --clean true

As of 4.0.0, the default parser expects all options to have a value, even boolean ones, and the reason was explained in #1248.

However, this seems to hinder things and affect the user experience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions