Skip to content

feat(command): show example values for parameters in help command#202

Open
Kronos279 wants to merge 2 commits into
seed4j:mainfrom
Kronos279:fix/174-show-example-values-in-help
Open

feat(command): show example values for parameters in help command#202
Kronos279 wants to merge 2 commits into
seed4j:mainfrom
Kronos279:fix/174-show-example-values-in-help

Conversation

@Kronos279

Copy link
Copy Markdown

Fixes #174

The help command now displays example values for module parameters,
fetched from the defaultValue already defined in the Seed4J module
definitions inside the core library.

Before:
--base-name=<basename*> Project short name (only letters and numbers) (required)
--node-package-manager=<nodepackagemanager*> Node package manager (required)
--project-name=<projectname*> Project full name (required)

After:
--base-name=<basename*> Project short name (only letters and numbers) e.g. seed4jSampleApplication (required)
--node-package-manager=<nodepackagemanager*> Node package manager e.g. npm (required)
--project-name=<projectname*> Project full name e.g. Seed4J Sample Application (required)

Verified with: ./mvnw clean verify

@renanfranca

Copy link
Copy Markdown
Contributor

@Kronos279: I am sorry. I didn't see it before. I turned on my email notifications for every issue and pull request update so that this does not happen again.

If you are interested in continuing the change, I think the requirement has changed a bit. For example, --node-package-manager has two possible values. You can see it here:

It is implemented as completion candidates, but the same idea applies to the description.

I suggest creating a specific test for that behavior instead of using an existing test. For example, you can test it with the command:

~$ seed4j apply init --help
Usage: seed4j apply init [-hV] [--[no-]commit] [--plan]
                        [--base-name=<basename*>] [--end-of-line=<endofline>]
                        [--indent-size=<indentsize>]
                        [--node-package-manager=<nodepackagemanager*>]
                        [--project-name=<projectname*>]
                        [--project-path=<projectpath>]
Init project
     --base-name=<basename*>
                     Project short name (only letters and numbers) (required)
     --[no-]commit   Initialize Git if needed and commit generated changes;
                       --no-commit skips Git init and commit
     --end-of-line=<endofline>
                     Type of line break (lf or crlf)
 -h, --help          Show this help message and exit.
     --indent-size=<indentsize>
                     Number of spaces in indentation
     --node-package-manager=<nodepackagemanager*>
                     Node package manager (required)
     --plan          Print the resolved module parameters and value sources
                       without applying changes
     --project-name=<projectname*>
                     Project full name (required)
     --project-path=<projectpath>
                     Project Path Folder
 -V, --version       Print version information and exit.

Looks like --end-of-line has the possible values in the description already.

Feel free to ask me anything.

@Kronos279 Kronos279 force-pushed the fix/174-show-example-values-in-help branch from f9b5916 to ecc3550 Compare July 4, 2026 23:23
@Kronos279

Copy link
Copy Markdown
Author

Hi @renanfranca , I have made the required changes. The help output now displays completion candidates (e.g. npm, pnpm for --node-package-manager) alongside the default value hints for free-text parameters. I have also added a dedicated test for seed4j apply init --help as suggested. The commit has been pushed to this PR. Please let me know if anything else needs to be adjusted.

@renanfranca

Copy link
Copy Markdown
Contributor

@Kronos279 : Excellent! The only thing missing is coverage. I think you could create a new test using a module that has a parameter but no examples.

Sorry, I do not have access to a computer right now to check which module meets that condition, or even whether a module with a parameter but no "example" exists.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The help command should show example values for the missing parameters

2 participants