Added raw-json field file path support to httpie-completion.

This commit is contained in:
Claus Klingberg 2016-12-18 19:22:53 +01:00
parent d170ef1363
commit e5bd16f740
1 changed files with 8 additions and 4 deletions

View File

@ -36,6 +36,7 @@
# #
# * Akira Maeda <https://github.com/glidenote> # * Akira Maeda <https://github.com/glidenote>
# * Valodim <https://github.com/Valodim> # * Valodim <https://github.com/Valodim>
# * Claus Klingberg <https://github.com/cjk>
# #
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*- # -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-
@ -72,16 +73,18 @@ _httpie_params () {
compset -P '(#b)([^:@=]#)' compset -P '(#b)([^:@=]#)'
local name=$match[1] local name=$match[1]
if compset -P ':'; then if compset -P '='; then
_message "$name header content" _message "$name data field value"
elif compset -P '@'; then elif compset -P '@'; then
_files _files
elif compset -P ':=@'; then
_files
elif compset -P ':='; then elif compset -P ':='; then
_message "$name raw json data" _message "$name raw json data"
elif compset -P '=='; then elif compset -P '=='; then
_message "$name url parameter value" _message "$name url parameter value"
elif compset -P '='; then elif compset -P ':'; then
_message "$name data field value" _message "$name header content"
else else
typeset -a ops typeset -a ops
ops=( ops=(
@ -90,6 +93,7 @@ _httpie_params () {
'==:request parameter' '==:request parameter'
'@:data file field' '@:data file field'
'\:=:raw json field' '\:=:raw json field'
'\:=@:raw json field file path'
) )
_describe -t httpparams "parameter types" ops -Q -S '' _describe -t httpparams "parameter types" ops -Q -S ''
fi fi