From 5659c469b064e38a993a0fa40613ad6fc1f024ab Mon Sep 17 00:00:00 2001 From: Jorge Bucaran Date: Thu, 31 Mar 2016 03:19:44 +0900 Subject: [PATCH] Bring spin back to avoid installing issues. Spin for everyone. --- completions/spin.fish | 2 + functions/spin.fish | 74 ++++++++++++++++++++++++++++++++++++- man/man1/fisher-uninstall.1 | 10 ++--- man/man1/fisher-update.1 | 22 +---------- man/man1/spin.1 | 60 ++++++++++++++++++++++++++++++ man/man1/spin.md | 43 +++++++++++++++++++++ test/spin.fish | 22 +++++++++++ 7 files changed, 206 insertions(+), 27 deletions(-) create mode 100644 completions/spin.fish create mode 100644 man/man1/spin.1 create mode 100644 man/man1/spin.md create mode 100644 test/spin.fish diff --git a/completions/spin.fish b/completions/spin.fish new file mode 100644 index 0000000..c150f4a --- /dev/null +++ b/completions/spin.fish @@ -0,0 +1,2 @@ +set -l IFS \t +spin -h | __fisher_complete spin diff --git a/functions/spin.fish b/functions/spin.fish index f2dff51..350c674 100644 --- a/functions/spin.fish +++ b/functions/spin.fish @@ -1,3 +1,73 @@ -function spin -a commands - fish -c "$commands" ^ /dev/null +function spin -d "Background job spinner" + set -l format " @\r" + set -l commands + set -l spinners "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏" + set -l error /dev/stderr + + getopts $argv | while read -l 1 2 + switch "$1" + case _ + set commands $commands ";$2" + + case s style + set spinners $2 + + case f format + set format $2 + + case error + set error $2 + + case h help + printf "Usage: spin [--style=