bd792f09a12bb654ede799222de5c35ea770bbf9

Author
Robby Russell <robby@planetargon.com>
Committer
Robby Russell <robby@planetargon.com>
Date

Message

Merge pull request #3444 from lululau/httpie-pr

Add completion for httpie

Diff

 1diff --git a/plugins/httpie/httpie.plugin.zsh b/plugins/httpie/httpie.plugin.zsh
 2new file mode 100644
 3index 0000000000000000000000000000000000000000..68ead6c67f16d94ffee2dc4985eb811418053083
 4--- /dev/null
 5+++ b/plugins/httpie/httpie.plugin.zsh
 6@@ -0,0 +1,33 @@
 7+function _httpie_completion() {
 8+  _arguments -C \
 9+    '(- 1 *)--version[display version information]' \
10+    '(-j|--json)'{-j,--json}'[(default) Data items from the command line are serialized as a JSON object]' \
11+    '(-f|--form)'{-f,--form}'[Data items from the command line are serialized as form fields]' \
12+    '(--pretty)--pretty[<all,colors,format,none> Controls output processing]:options' \
13+    '(-s|--style)'{-s,--style}'[Output coloring style]' \
14+    '(-p|--print)'{-p,--print}'[String specifying what the output should contain: H(request headers), B(request body), h(response headers), b(response body)]' \
15+    '(-v|--verbose)'{-v,--verbose}'[Print the whole request as well as the response. Shortcut for --print=HBbh.]' \
16+    '(-h|--headers)'{-h,--headers}'[Print only the response headers. Shortcut for --print=h]' \
17+    '(-b|--body)'{-b,--body}'[Print only the response body. Shortcut for --print=b]' \
18+    '(-S|--stream)'{-S,--stream}'[Always stream the output by line, i.e., behave like `tail -f'"'"']' \
19+    '(-o|--output)'{-o,--output}'[Save output to FILE]:file:_files' \
20+    '(-d|--download)'{-d,--download}'[Do not print the response body to stdout. Rather, download it and store it in a file. The filename is guessed unless specified with --output filename. This action is similar to the default behaviour of wget.]' \
21+    '(-c|--continue)'{-c,--continue}'[Resume an interrupted download. Note that the --output option needs to be specified as well.]' \
22+    '(--session)--session[Create, or reuse and update a session. Within a session, custom headers, auth credential, as well as any cookies sent by the server persist between requests]:file:_files' \
23+    '(--session-read-only)--session-read-only[Create or read a session without updating it form the request/response exchange]:file:_files' \
24+    '(-a|--auth)'{-a,--auth}'[<USER:PASS> If only the username is provided (-a username), HTTPie will prompt for the password]' \
25+    '(--auth-type)--auth-type[<basic, digest> The authentication mechanism to be used. Defaults to "basic".]' \
26+    '(--proxy)--proxy[<PROTOCOL:PROXY_URL> String mapping protocol to the URL of the proxy]' \
27+    '(--follow)--follow[Set this flag if full redirects are allowed (e.g. re-POST-ing of data at new Location).]' \
28+    '(--verify)--verify[<VERIFY> Set to "no" to skip checking the host'"'"'s SSL certificate. You can also pass the path to a CA_BUNDLE file for private certs. You can also set the REQUESTS_CA_BUNDLE  environment variable. Defaults to "yes".]' \
29+    '(--timeout)--timeout[<SECONDS> The connection timeout of the request in seconds. The default value is 30 seconds]' \
30+    '(--check-status)--check-status[By default, HTTPie exits with 0 when no network or other fatal errors occur. This flag instructs HTTPie to also check the HTTP status code and exit with an error if the status indicates one.]' \
31+    '(--ignore-stdin)--ignore-stdin[Do not attempt to read stdin]' \
32+    '(--help)--help[Show this help message and exit]' \
33+    '(--traceback)--traceback[Prints exception traceback should one occur]' \
34+    '(--debug)--debug[Prints exception traceback should one occur, and also other information that is useful for debugging HTTPie itself and for reporting bugs]' \
35+    '1: :->cmds' \
36+    '*: :->args' && ret=0
37+}
38+
39+compdef _httpie_completion http