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

Infer source files and language thereof #2

Open
alis0nc opened this issue Oct 31, 2017 · 2 comments
Open

Infer source files and language thereof #2

alis0nc opened this issue Oct 31, 2017 · 2 comments

Comments

@alis0nc
Copy link

alis0nc commented Oct 31, 2017

Perhaps something could be done with running file(1) on the whole directory to pick up what files are source files (as opposed to plain old text) and their language, instead of asking the user for the project language and source file extensions.

@alis0nc
Copy link
Author

alis0nc commented Oct 31, 2017

That does introduce a dependency on file(1) though, and your distribution's magic files, so it could lead to different behaviour on different Unixen.

@arosspope
Copy link
Owner

arosspope commented Oct 31, 2017

Whilst I do think that this idea has merit, it would mean we would need to maintain some kind of mapping between file extensions, the output of file(1) and the languages the LaTeX source listings package knows about. Additionally (whilst it probably only applies to c/c++ and perhaps a moot point) some file extensions map to multiple languages, so it might be somewhat difficult to infer the desired language of the overall project.

If you can propose a method to overcome/implement this functionality, then I would be interested to hear it. Otherwise, I think letting the user choose the language makes the script simple and is the best path for now.

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

No branches or pull requests

2 participants