abathur / resholve

a shell resolver? :) (find and resolve shell script dependencies)
MIT License
231 stars 5 forks source link

Parsing error on &! #85

Open AndrewKvalheim opened 2 years ago

AndrewKvalheim commented 2 years ago

zsh has a &! syntax for starting a disowned job, e.g.:

sleep 3s &!

Using this in a script causes resholve to fail with a parsing error:

$ resholve --interpreter "$SHELL" --path '' <<< 'sleep 3s &!'
  sleep 3s &!
             ^
[ stdinNone ]:2: error: Invalid word while parsing command
abathur commented 2 years ago

This is expected (for now, at least). It's documented in the manpage (here's an excerpt from the plaintext copy):

https://github.com/abathur/resholve/blob/80e93633c824175e8afb25b0fa02aee35203e6fc/docs/resholve.1.txt#L202-L213

In the near-ish term, we can probably:

In the long run I would like for resholve to be a little more parser-agnostic, but my gut says that'll be pretty difficult. I made some strides over the last year to build a more domain-specific abstraction layer between resholve and the OSH parser, but it is still tightly coupled to some of Oil's abstractions and APIs.

AndrewKvalheim commented 2 years ago

Thanks, makes sense. Indeed, I’d only been looking at the main and nixpkgs readmes. For now I’ll just use a wrapper around resholve to temporarily replace &! with @AMPERSAND_EXCLAMATION@.

abathur commented 2 years ago

Good point--if pluggable parsers don't seem to be tractable, I guess pluggable in/out filters might be...