cli
cli copied to clipboard
Automatically get language from file extension
It would make it way more comfortable if I could just pass a file or files and the CLI grabs itself the file language.
Strongly agree. There was some related work in Unibeautify core a while ago: https://github.com/Unibeautify/unibeautify/pull/152
Unibeautify core has functions to get the language based on several criteria, including file extension. What are you trying to do with it in the CLI exactly?
Avoid having to pass --language foo manually. It would be convenient and I can't think of any harm it would cause.
The reason for passing the language is so users can beautify specific blocks of code. For example, they might want to beautify HTML code in a .php file.
I'm not against retrieving the language from the file extension if the user doesn't specify the language through --language.
That is what I suggest. Using both, first get the language automatically and if the user set the flag use this language
Sent with GitHawk