httpie / http-prompt

An interactive command-line HTTP and API testing client built on top of HTTPie featuring autocomplete, syntax highlighting, and more. https://twitter.com/httpie
https://http-prompt.com
MIT License
8.96k stars 326 forks source link

Support output redirect with env variables #120

Open vtrbtf opened 7 years ago

vtrbtf commented 7 years ago

It would be nice to have env var expansion when saving the current env Today that is not possible:

> env > "$HOME/httpreq"
[Errno 2] No such file or directory: u'$HOME/httpreq'

>  env > `$HOME/http_token`
/bin/sh: /Users/vbarbosa/http_token: No such file or directory
IndexError: string index out of range

Parse tree:
<Node called "redir_write" matching "> `$HOME/http_token`">  <-- *** We were here. ***
    <RegexNode called "_" matching "">
    <Node matching ">">
    <RegexNode called "_" matching " ">
    <Node called "string" matching "`$HOME/http_token`">
        <Node called "unquoted_string" matching "`$HOME/http_token`">
            <Node called "unquoted_stringitem" matching "`$HOME/http_token`">
                <Node called "shell_subs" matching "`$HOME/http_token`">
                    <Node matching "`">
                    <RegexNode called "shell_code" matching "$HOME/http_token">
                    <Node matching "`">
    <RegexNode called "_" matching "">