Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

removed support for curl's -q option in favor of resty's shadowed ver…

…sion
  • Loading branch information...
commit da00b8e26c801d5c3df51ed61f5abcc37273e973 1 parent 0a8b2ad
@micha authored
Showing with 4 additions and 11 deletions.
  1. +4 −11 resty
View
15 resty
@@ -14,7 +14,7 @@ export _resty_path=""
export _resty_nohistory=""
function resty() {
- local confdir host cookies method h2t editor domain _path opt dat res ret out err verbose raw i j d tmpf args2 wantdata vimedit quote query maybe_query norc
+ local confdir host cookies method h2t editor domain _path opt dat res ret out err verbose raw i j d tmpf args2 wantdata vimedit quote query maybe_query
local -a curlopt
local -a curlopt2
@@ -35,14 +35,7 @@ function resty() {
j=1
for i in "$@"; do
- if [ -n "$maybe_query" ]; then
- if [ "$i" = "${i#-}" ]; then
- query="?$i"
- unset norc
- fi
- unset maybe_query
- continue
- fi
+ [ -n "$maybe_query" -a -z "$query" ] && query="?$i" && continue
([ "$i" = "--verbose" ] || echo "$i" | grep '^-[a-zA-Z]*v[a-zA-Z]*$' >/dev/null) \
&& verbose="yes" && continue
[ "$i" = "-V" ] && vimedit="yes" && continue
@@ -50,7 +43,7 @@ function resty() {
&& raw="yes" && continue
[ "$i" = "-W" ] && continue
[ "$i" = "-Q" ] && quote="yes" && continue
- [ "$i" = "-q" ] && maybe_query="yes" && norc="-q" && continue
+ [ "$i" = "-q" ] && maybe_query="yes" && continue
curlopt[j]="$i" && j=$((j + 1))
done
@@ -82,7 +75,7 @@ function resty() {
[ "$method" = "HEAD" ] && opt="-I" && raw="yes"
[ "$method" = "OPTIONS" ] && opt="-I" && raw="yes"
eval "args2=( $(cat "$confdir/$domain" 2>/dev/null |sed 's/^ *//' |grep ^$method |cut -b $((${#method}+2))-) )"
- res=$((((curl $norc -sLv $opt "$dat" -X $method \
@micha Owner
micha added a note

asdf foo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ res=$((((curl -sLv $opt "$dat" -X $method \
-b "$cookies/$domain" -c "$cookies/$domain" \
"${args2[@]}" "${curlopt2[@]}" "${curlopt[@]}" "$_path$query" \
|sed 's/^/OUT /' && echo) 3>&2 2>&1 1>&3) \
Please sign in to comment.
Something went wrong with that request. Please try again.