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

Fallback command parser #137

Closed
wants to merge 1 commit into from
Closed

Fallback command parser #137

wants to merge 1 commit into from

Conversation

tie
Copy link

@tie tie commented Jun 15, 2018

Added fallback command parser in case shell is not set (or installed on the system).
In such case, github.com/mattn/go-shellwords is used for parsing the arguments.

Btw, looks like there is a bug in gribble. It trims quotes from string token strings.Trim(p.TokenText(), "\"`"), so <"\""> input will produce <\>.

Added fallback command parser in case shell is not set (or installed on the system).

See https://github.com/mattn/go-shellwords
@BurntSushi
Copy link
Owner

Could you please explain why you want this? What is the motivation?

@tie
Copy link
Author

tie commented Jun 15, 2018

Sure. In my opinion, requiring external command interpreter is overkill, mostly because I've never really used any of the shell features inside the X session, e.g., for running piped commands (and I doubt anyone else does this often). And while it is possible to wrap the code from the PR in a standalone executable (with -c flag support), I think it's worth adding some default command parser in the wingo.

@BurntSushi
Copy link
Owner

Thanks for elaborating. Unfortunately, I don't agree. I think relying on a shell to exist is just fine, and I do not want the extra maintenance burden of a custom shell lexer.

Wingo is in maintenance mode and isn't really actively developed. I do enough to keep the lights on because I still use it. So with that said, if you want this functionality badly enough, I'm going to have to ask you to maintain the patch yourself.

@BurntSushi BurntSushi closed this Jun 15, 2018
@tie
Copy link
Author

tie commented Jun 15, 2018

Ok, that's fine with me. What about the gribble parser?

Btw, looks like there is a bug in gribble. It trims quotes from string token strings.Trim(p.TokenText(), "\"`"), so <"\""> input will produce <\>.

This line does not look like an expected behavior. There is even a workaround in wingo's code. I'd rather use strconv.Unquote instead of strings.Trim for this purpose, but the fix will require removing workaround from wingo anyway.

Should I create an issue in gribble's repository?

@BurntSushi
Copy link
Owner

Is the bug actually impacting you?

I cannot understate how conservative I am with changes to Wingo. There is no test suite, so my default reaction to any proposed change is to not do it.

@tie
Copy link
Author

tie commented Jun 15, 2018

Got it. The workaround works just fine in most cases, so if you don't want to make changes, it's ok to leave everything as it is now.
Thanks for your replies.

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

Successfully merging this pull request may close these issues.

None yet

2 participants