Skip to content

Fix inverted SYNOPSIS brackets in help output - #1384

Closed
ezeprimo wants to merge 1 commit into
spring-projects:mainfrom
ezeprimo:fix/help-synopsis-brackets-949
Closed

ezeprimo wants to merge 1 commit into
spring-projects:mainfrom
ezeprimo:fix/help-synopsis-brackets-949

Conversation

@ezeprimo

@ezeprimo ezeprimo commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1389

Required options were rendered as [--opt Type] and optional ones as bare text, opposite to Unix convention and to the arguments logic in the same file. This made required options look optional in the help.

Note: this PR was originally opened against #949; per maintainer feedback it is unrelated to that issue (see #1389). It has been rebased on latest main, moving the fix from Help to CommandHelpRenderer, where help rendering now lives.

Summary:

  • Render required options bare (--opt Type) and optional ones bracketed ([--opt Type]) in SYNOPSIS
  • Updated the test expectations that pinned the old output
File Change
spring-shell-core/.../command/CommandHelpRenderer.java Un-inverted SYNOPSIS brackets (2 lines)
spring-shell-core/.../command/CommandHelpRendererTests.java Updated 2 synopsis expectations
spring-shell-core/.../command/HelpTests.java Updated 6 synopsis expectations

Test plan:

  • mvn -pl spring-shell-core -am -Dtest=CommandHelpRendererTests,HelpTests test: 16/16 green (JDK 17)
  • mvn -pl spring-shell-core -am test: 281/281 green

@ezeprimo
ezeprimo force-pushed the fix/help-synopsis-brackets-949 branch from ceaee79 to 7d08b68 Compare September 21, 2026 23:52
@fmbenhassine

Copy link
Copy Markdown
Contributor

Thank you for the PR. I don't see how it is related to #949 .

But it actually fixes a valid inconsistency, I created an issue for it: #1389.

Please rebase this PR on the latest main as the help rendering moved to CommandHelpRenderer (which still has the inverted logic today) and it should be good to merge.

@fmbenhassine fmbenhassine added the status/need-feedback Calling participant to provide feedback label Sep 24, 2026
Required options were rendered as [--opt Type] and optional ones as bare text, opposite to Unix convention. Render required options bare and optional ones bracketed in CommandHelpRenderer, where help rendering now lives.

Fixes spring-projects#1389

Signed-off-by: ezequiel primon <ezeprimo.ia@gmail.com>
@ezeprimo
ezeprimo force-pushed the fix/help-synopsis-brackets-949 branch from 7d08b68 to 694f3e7 Compare September 24, 2026 21:08
@ezeprimo

Copy link
Copy Markdown
Contributor Author

Done. Rebased and moved the fix to CommandHelpRenderer. It now closes #1389. Ready for another look when you have a moment.

@fmbenhassine

Copy link
Copy Markdown
Contributor

LGTM now 👍 Rebased and merged as 8277c60.

Thank you for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/need-feedback Calling participant to provide feedback

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent SYNOPSIS brackets: required options shown as optional, opposite of arguments

2 participants