Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically get language from file extension #102

Open
muuvmuuv opened this issue Oct 24, 2018 · 5 comments
Open

Automatically get language from file extension #102

muuvmuuv opened this issue Oct 24, 2018 · 5 comments

Comments

@muuvmuuv
Copy link

It would make it way more comfortable if I could just pass a file or files and the CLI grabs itself the file language.

@lassik
Copy link
Contributor

lassik commented Oct 24, 2018

Strongly agree. There was some related work in Unibeautify core a while ago: Unibeautify/unibeautify#152

@stevenzeck
Copy link
Contributor

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?

@lassik
Copy link
Contributor

lassik commented Oct 24, 2018

Avoid having to pass --language foo manually. It would be convenient and I can't think of any harm it would cause.

@stevenzeck
Copy link
Contributor

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.

@muuvmuuv
Copy link
Author

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

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

No branches or pull requests

4 participants