feat(command): show example values for parameters in help command#202
feat(command): show example values for parameters in help command#202Kronos279 wants to merge 2 commits into
Conversation
|
@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, 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. |
f9b5916 to
ecc3550
Compare
|
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. |
|
@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. |
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