What if Newman CLI could have auto-suggest for CLI commands like git commands
E.G user could mistype help as hlp
The current behavior currently display the below information in the screenshot to the user when a command is mistyped with a missing character
I would like to work on this issue.
Sure. This sounds exciting. But do note that newman has very few commands to do autocomplete. There are far higher user impact features and issues that can be tackled as well. 馃槉
If you do work on this, please do read https://github.com/postmanlabs/newman/blob/develop/.github/CONTRIBUTING.md
Post an expected behaviour and also post how someone else will maintain this feature going forward. Which terminals will this work in and what would be the limitations, if any.
Looking forward to the contribution. 鉂わ笍
@shamasis Thanks. I'll post all the details about this new feature.
@gittysachin oh well, I waited patiently for a review of this feature before suggesting an implementation but I guess you talked about implementing it first. I hope to see what you create 鉂わ笍
@TheDhejavu I tried to make changes. I think that I coded correctly. But how can I build this and test on my new changes? Cause it's just working on the last version as I cloned the repo.
@gittysachin correct me if I'm wrong, you mean you have been working on a few changes before this and now you trying to implement this new feature on top of these changes? Or you are just starting out and trying to figure out how to build and test it on the new changes made to the repo ?
@TheDhejavu I tried changing the code and I think I wrote it correctly. But now it's not doing anything new when I'm trying node ./bin/newman.js v. So is there any way I can try with my new changes? It's just reacting as the old. I made the feature and I want to test that so that I can send a pull request.
@gittysachin Oh, I get it now. try using a different command like node ./bin/newman.js --hlp , it should give a list of defined suggestion like
Do you mean --help
Newman seems to have few main commands which includes --version --help and run. You can try building something to handle subcommands too. That would be interesting too
@TheDhejavu thank you. I tried testing that command. But something was going wrong. It was just saying error: invalid command `--hlp`. No worries, I'll try to make it again and will look into the problem.
@gittysachin Exactly instead of throwing this kind of error, it should give you a list of related commands to --hlp
Any updates @gittysachin ?
Great idea but as mentioned in https://github.com/postmanlabs/newman/issues/2244#issuecomment-595059566, Newman at the moment has only run command and on error, it already shows the help text with all the commands and options listed.
Closing this right now, maybe we need something like this once we have 100s of commands like git 馃槄
Most helpful comment
@gittysachin oh well, I waited patiently for a review of this feature before suggesting an implementation but I guess you talked about implementing it first. I hope to see what you create 鉂わ笍