-
Notifications
You must be signed in to change notification settings - Fork 329
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
shell commands - lexer rules, pipe to shell cmd redirection, tests #74
shell commands - lexer rules, pipe to shell cmd redirection, tests #74
Conversation
Thanks, @fogine ! This was something I wanted to do in PR #61. For your question, yes, it's possible to write a shell command in a full quoted mutation, see the test cases here: https://github.com/eliangcs/http-prompt/blob/e0308a106f02b20e3e62b17de2d1e344d1c4d624/tests/test_execution.py#L647 Full quoted mutation was implemented because it works on httpie. For instance, |
…kticks shell command. Eg.: localhost> httpie | `echo "sed 's/localhost/127.0.0.1/'"`
I've added the "pipe to shell command redirection" to this pull request as discussed in #61 PR. localhost> httpie get | tee /tmp/test # output of `httpie get` is redirected to shell subprocess cmd: `tee /tmp/test`
localhost> get some==data| tee /tmp/test # supports "action" commands
localhost> httpie | `echo "sed 's/localhost/127.0.0.1/' "` # this will be "transformed" to httpie | sed 's/localhost/127.0.0.1/' .... Also this is the case where I'm not sure if it's implemented in the best possible way Lexer rules covers all the possible options now. I think this PR implements all the remaining functionality to the #61 PR now...? |
@fogine Sorry for my late reply. I'll refactor the code first (in branch |
Overall looks good. Merged. We can keep fixing details after I resolve the conflicts between PR #61 and the master branch. Thanks! |
As title says... lexer rules for shell commands has been fully implemented... I've added some more tests for this as well...
I've a question, though.
Now, it's possible to define a shell command in full single/double-quoted request mutation. For example, you can do this:
httpie post "`echo name`=value"
Is that the expected behavior, @eliangcs ?
If so, I'll add tests for this...
ps: I'm asking because I couldn't think of a reason why the full single/double-quoted request mutation feature was implemented in first place...