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

interpolation (aka command substitution) #70

Open
khuongduybui opened this issue Mar 14, 2016 · 5 comments
Open

interpolation (aka command substitution) #70

khuongduybui opened this issue Mar 14, 2016 · 5 comments

Comments

@khuongduybui
Copy link
Contributor

Let's say I have a which command, I want to

$ which code
C:\Program Files (x86)\Microsoft VS Code\bin\code.cmd
$ echo "Here is your path to code: $(which code)"
Here is your path to code: C:\Program Files (x86)\Microsoft VS Code\bin\code.cmd
@khuongduybui khuongduybui changed the title interpolation interpolation (aka command substitution) Mar 14, 2016
@nfischer
Copy link
Collaborator

I don't think this is supported yet, but we may be able to add support for this without too much trouble.

@dthree we could probably solve this by looking for this pattern during pre parsing and recursively calling vorpal on the string, right? Or would the vorpal instance not be available there?

@dthree
Copy link
Owner

dthree commented Mar 14, 2016

@khuongduybui very good point.

@nfischer I definitely want to add this, but then again I really, really want to add all of the bash functionality, and so adding this now would be double work.

I know I haven't been active recently on it, I've had no time. But trying to get some time soon.

@nfischer
Copy link
Collaborator

I'll take a look and see how easy it is. If it's not too much, I think we can just add the feature now and reimplement with the full bash parser later on down the road

@dthree
Copy link
Owner

dthree commented Mar 14, 2016

K awesome.

@nfischer
Copy link
Collaborator

So I looked into this. We would essentially need to instantiate the preparser using the same vorpal instance. From there, the parsing is pretty simple. I can write something up for this. The only messy part is that we have to explicitly pass the vorpal instance around, or make the preparser an attribute of the vorpal instance.

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

3 participants