commit 4bd1ac05b0801cc531ae26edadd02cce99ff3e0d
parent a3364d7bc4a019854a973377ce52edb403cf938e
Author: Alex Balgavy <a.balgavy@gmail.com>
Date: Tue, 23 Jul 2019 14:07:57 +0200
httpc: http request console with httpie
Former-commit-id: ceba89742b8b9ecac8e7c87b47b8228df229f5da
Diffstat:
2 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -21,6 +21,7 @@ If you read a script and see some improvements that could be made, let me know.
* `executable`: my first script. Makes any file executable, along with further options. Usage: `executable file.sh`
* `ffmpeg-split.py`: split videos using ffmpeg. [Here's the README.](scripts/ffmpeg-split-README.md)
* `global-git-status`: git status of all of your cloned git repositories
+* `httpc`: an interactive http request console using httpie
* `it-style`: can find and set the genre in a track in iTunes (along with its Ruby helper), using the Discogs database (you need an API key, set $DISCOGS_API_TOKEN in your profile). Usage: click/play a track in iTunes, and run the program.
* `linkdir`: symlink all files/folders from source dir to target dir. Usage: `linkdir $source` to create symlinks in cwd, `linkdir $source $target` otherwise.
* `mdvl`: markdown renderer in Python
diff --git a/scripts/httpc b/scripts/httpc
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+if ! command -v http &> /dev/null; then
+ echo "Please install httpie"
+ exit 1
+fi
+set -e
+while :; do
+ echo -n "http> "
+ read -a cmd
+ http "${cmd[0]}" "http://localhost:8000${cmd[1]}"
+done