Allow to specify language #34

Closed
opened 2024-11-15 10:48:55 +01:00 by piegames · 5 comments

It looks like mergiraf relies only on the file extension for language detection. I just ran into a conflict of a .hh file, but mergiraf says it doesn't know how to handle that despite it being some standard C++ header file. A CLI flag to manually specify the language for some cases would be helpful.

It looks like mergiraf relies only on the file extension for language detection. I just ran into a conflict of a `.hh` file, but mergiraf says it doesn't know how to handle that despite it being some standard C++ header file. A CLI flag to manually specify the language for some cases would be helpful.
Owner

That would make sense indeed, thanks for suggesting.

That would make sense indeed, thanks for suggesting.

I've hacked this in b3e99c0560 . Not sure if this is the way as I'm not comfortable enough in Rust and it lacks tests.

I've hacked this in https://codeberg.org/seruman/mergiraf/commit/b3e99c0560ace4a523854dda0caa8fd9b97c255e . Not sure if this is the way as I'm not comfortable enough in Rust and it lacks tests.
Owner

That sounds like a very sensible start! I don't know if the existing names in the language profiles are good enough as identifiers to be passed via the CLI. We could adapt them or introduce a separate field for it if needed.

That sounds like a very sensible start! I don't know if the existing names in the language profiles are good enough as identifiers to be passed via the CLI. We could adapt them or introduce a separate field for it if needed.
Member

I did this and only found this issue afterwards. One thing I did differently is that the command line language overrides automatic detection. The classic case I ran into this for is that .pl is the extension for both Prolog and Perl, so manual intervention is required in such cases.

See #296.

I did this and only found this issue afterwards. One thing I did differently is that the command line language overrides automatic detection. The classic case I ran into this for is that `.pl` is the extension for both Prolog and Perl, so manual intervention is required in such cases. See #296.
Owner

Closed by #327

Closed by #327
Sign in to join this conversation.
No milestone
No project
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: mergiraf/mergiraf#34
No description provided.