Closed muuvmuuv closed 5 years ago
I agree. We haven't done a lot of work on the CLI yet. Hopefully the pace is picking up soon :)
I think your reasoning makes sense.
I would prefer to keep the name to be correct and exact. However, I also want the user experience to be better. How about for the time being we make autocorrect / recommendations to the user like git
does? See https://stacktoheap.com/blog/2015/11/01/git-autocorrect-feature/ for example.
$ git psuh
git: 'psuh' is not a git command. See 'git --help'.
Did you mean this?
push
My proposal:
JavaScript
not javascript
).unibeautifyrc
file language keys should be properly cased
javascript
==> JavaScript
)-l <language>
is not found, find the best match@Glavin001 love that idea! 🎉
🎉 Awesome! I'm open to receiving a Pull Request to Unibeautify CLI which reports an error to the user for incorrectly spelt language names and then recommends similarly spelt languages for the user to fix.
I'm open to suggests on the message format. We can discuss in the PR. For example:
$ unibeautify -f index.js -l javascript
Language 'javascript' is not found. Did you mean "JavaScript"?
This issue was moved to Unibeautify/unibeautify-cli#115
Describe the feature
I have started working more with the Unibeautify CLI and had noticed that it is really hard to understand how it is working. I started with
unibeautify index.js -l javascript
, then I saw that I need to flag the file with-f
and after a talk with @stevenzeck (See: unibeautify-cli/issues/103) I had to letterjavascript
correctly. So the correct way wasunibeautify -f index.js -l JavaScript
.This is IMHO, a little bit to difficult for the most users because not every developer knows the correct lettering of every language. I think we need to make this case intensitive. The corresponding lines are LanguageManager.ts#L18 and LanguageManager.ts#L25