dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

httpc (362B)


      1 #!/usr/bin/env bash
      2 # A wrapper around httpie, providing a prompt for repeated querying of the same host.
      3 if ! command -v http &> /dev/null; then
      4   echo "Please install httpie"
      5   exit 1
      6 fi
      7 set -e
      8 host="${1:-localhost:8000}"
      9 echo "HTTPie console on $host"
     10 while :; do
     11   echo -n "http> "
     12   read -a cmd
     13   http "${cmd[0]}" "http://$host${cmd[1]}" "${cmd[@]:2}"
     14 done