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

Feature Request: recognition of shebangs #192

Open
anadon opened this issue Jun 25, 2024 · 3 comments
Open

Feature Request: recognition of shebangs #192

anadon opened this issue Jun 25, 2024 · 3 comments

Comments

@anadon
Copy link

anadon commented Jun 25, 2024

Recognizing shebangs ( #!/usr/bin/sh or #! /usr/bin/env sh or similar ) can be used with a word splitting pattern match to make sure to match the shell being invoked is supported by Morbig.

@Niols
Copy link
Member

Niols commented Jun 27, 2024

This is indeed a good idea. There is the --skip-nosh flag that does something similar, but not quite what you are looking for. It looks pretty ad-hoc anyways, so it would make sense to replace it by a better way to declare how one wants to handle shebangs.

@anadon
Copy link
Author

anadon commented Jun 27, 2024

If you could point me in the right direction, I'll try to take it from there.

@Niols
Copy link
Member

Niols commented Jun 27, 2024

I wasn't the instigator of the --skip-nosh option, but I would say the best start is to look how it is implemented. As a first idea, I would say that we probably need two options, one to say how to reject files (the current --skip-nosh option and what you suggest) and one to say what to do to rejected files (skip or fail, I suppose). Maybe:

  • --shebangs-recognition which can be none, only-sh, reject-nosh (default to none)
  • --shebangs-recognition-strictness which can be skip or fail (default to fail would make sense imo)

(I'm not very good at naming, so feel free to suggest other things!)

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

No branches or pull requests

2 participants