mirror of https://github.com/jorgebucaran/fisher
Ahoy! We are getting close to 0.8.0
* Move AUTHORS -> THANKS and remove automatic generation. THANKS is more sensible than AUTHORS. CREDITS was second best. Also, after perusing similar files in other projects I noticed some entries lacking a valid email address and decided fow now this file should be curated manually to make sure each entry contains a useful link. This allows users who have contributed to the project ways other than committing code to be added to the list as well. * Rename wait -> spin. * Remove extra padding in links. (Cosmetic) * Update to reflect API refactorings. * Fix bug causing brackets to show up in description. * Implement using spin function. * __fisher_gist_to_name uses curl to query the GitHub API which will return a JSON stream even if the Gist could not be found. So, it's not possible to determine whether we failed or not using our spin function and actually need to check the returned string to see if it contains a valid name or not. * Let git pull write errors to stderr. * Use new internal __fisher_spin. * Extract spin to independent / external module and tweak Makefile to better integrate with new install process.pull/445/head
parent
1f16aa1521
commit
4b15cf374f
@ -1,6 +0,0 @@
|
||||
# Authors
|
||||
* Jorge Bucaran <[j@bucaran.me](mailto:j@bucaran.me)>
|
||||
* Daniel Perez <[daniel@claudetech.com](mailto:daniel@claudetech.com)>
|
||||
* Daniele Sluijters <[daenney@users.noreply.github.com](mailto:daenney@users.noreply.github.com)>
|
||||
* Hyeon Kim <[simnalamburt@gmail.com](mailto:simnalamburt@gmail.com)>
|
||||
* Kevin Ballard <[kevin@sb.org](mailto:kevin@sb.org)>
|
@ -0,0 +1,12 @@
|
||||
# Thank You
|
||||
|
||||
The following individuals have contributed to Fisherman.
|
||||
|
||||
* Daniel Perez @tuvistavie
|
||||
* Daniele Sluijters @daenney
|
||||
* Hyeon Kim @simnalamburt
|
||||
* Ian @ViViDboarder
|
||||
* Jorge Bucaran @bucaran
|
||||
* Kevin Ballard @kballard
|
||||
|
||||
:heart:
|
@ -1,8 +0,0 @@
|
||||
set -l IFS \t
|
||||
|
||||
complete -xc wait -n "__fish_seen_subcommand_from --spin" \
|
||||
-a "spinners arc star pipe ball flip mixer caret bar1 bar2 bar3"
|
||||
|
||||
complete -xc wait -n "not __fish_seen_subcommand_from --spin" -a "\t"
|
||||
|
||||
wait -h | __fisher_complete wait
|
@ -1,3 +1,3 @@
|
||||
function __fisher_help_parse
|
||||
sed -nE 's/^ *(-(.))?,? *--([^ =]+) *(.*)$/\4;\3;\2/p'
|
||||
sed -nE 's/^ *(-(.))?,? *--([^ =[]+) *(.*)$/\4;\3;\2/p'
|
||||
end
|
||||
|
@ -1,3 +1,3 @@
|
||||
function __fisher_key_bindings
|
||||
source $fisher_key_bindings ^ /dev/null
|
||||
source $fisher_binds ^ /dev/null
|
||||
end
|
||||
|
@ -1,4 +1,4 @@
|
||||
function __fisher_path_update -a path
|
||||
git -C $path checkout master --quiet ^ /dev/null
|
||||
git -C $path pull --rebase origin master --quiet ^ /dev/null
|
||||
git -C $path pull --rebase origin master --quiet
|
||||
end
|
||||
|
@ -0,0 +1,3 @@
|
||||
function spin -a commands
|
||||
fish -c "$commands" ^ /dev/stderr
|
||||
end
|
@ -1,105 +0,0 @@
|
||||
.\" generated with Ronn/v0.7.3
|
||||
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
||||
.
|
||||
.TH "WAIT" "1" "February 2016" "" "fisherman"
|
||||
.
|
||||
.SH "NAME"
|
||||
\fBwait\fR \- Run commands and wait with a spin
|
||||
.
|
||||
.SH "SYNOPSIS"
|
||||
\fBwait\fR \fIcommands\fR [\fB\-\-spin\fR=\fIarc\fR|\fIstar\fR|\fIpipe\fR|\fIball\fR|\fIflip\fR|\fImixer\fR|\fIcaret\fR|\fIbar1~3\fR]
|
||||
.
|
||||
.br
|
||||
\fBwait\fR \fIcommands\fR [\fB\-\-time\fR=interval] [\fB\-\-log\fR=file] [\fB\-\-format\fR=format] [\fB\-\-help\fR]
|
||||
.
|
||||
.SH "DESCRIPTION"
|
||||
Run \fIcommands\fR in the background and wait until the job has finished\. Any output to standard error indicates \fBwait\fR to return \fB1\fR\. While it waits, a customizable spinner is displayed in the command line\.
|
||||
.
|
||||
.SH "OPTIONS"
|
||||
.
|
||||
.TP
|
||||
\fB\-s \-\-spin=style|string\fR
|
||||
Set the spinner style\. See \fBStyles\fR for styles and details on how to customize the spinner tokens\.
|
||||
.
|
||||
.TP
|
||||
\fB\-t \-\-time=interval\fR
|
||||
Set spinner transition time delay in \fIseconds\fR\. A large value will refresh the spinner more slowly\. You may use decimal numbers to represent smaller numbers\. The default interval is \fB0\.02\fR\.
|
||||
.
|
||||
.TP
|
||||
\fB\-l \-\-log=file\fR
|
||||
Write the standard error output to a given \fIfile\fR\.
|
||||
.
|
||||
.TP
|
||||
\fB\-f \-\-format=format\fR
|
||||
Use the given \fIformat\fR to display the spinner\. The default format is \fB"\er@"\fR where \fB@\fR represents the spinner token and \fB\er\fR a carriage return, used to refresh (erase) the line\.
|
||||
.
|
||||
.TP
|
||||
\fB\-h \-\-help\fR
|
||||
Show usage help\.
|
||||
.
|
||||
.SH "STYLES"
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
arc, star, pipe, ball, flip, mixer, caret
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
bar1~3
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
If no style is given, \fBmixer\fR is used by default\. If you don\'t want to display any spinners, use \fB\-\-spin=""\fR\.
|
||||
.
|
||||
.SS "CUSTOMIZATION"
|
||||
In addition to the default styles, you can specify a string of character tokens to be used each per spinner refresh cycle\.
|
||||
.
|
||||
.P
|
||||
For example \fB\-\-spin=12345\fR will display the numbers from 1 to 5, and \fB\-\-spin=\. \-\-format=@\fR an increasing sequence of dots\.
|
||||
.
|
||||
.SS "PROGRESS BARS"
|
||||
Display a progress bar with a percent indicator using \fB\-\-spin=bar1~3\fR:
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
bar1: [=====] \fInum\fR%
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
bar2: [#####] \fInum\fR%
|
||||
.
|
||||
.IP "\(bu" 4
|
||||
bar3: \.\.\.\.\.\.\. \fInum\fR%
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "EXAMPLES"
|
||||
Run commands in the background and display a spinning pipe while until finished\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
wait \-\-spin=pipe "curl \-sS $URL"
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.P
|
||||
Write the standard error output to \fIdebug\.txt\fR\.
|
||||
.
|
||||
.IP "" 4
|
||||
.
|
||||
.nf
|
||||
|
||||
if not wait \-\-spin=pipe \-\-log=debug\.txt "curl \-sS $URL"
|
||||
return 1
|
||||
end
|
||||
.
|
||||
.fi
|
||||
.
|
||||
.IP "" 0
|
||||
.
|
||||
.SH "SEE ALSO"
|
||||
sleep(1)
|
||||
.
|
||||
.br
|
||||
|
@ -1,69 +0,0 @@
|
||||
wait(1) -- Run commands and wait with a spin
|
||||
============================================
|
||||
|
||||
## SYNOPSIS
|
||||
|
||||
`wait` *commands* [`--spin`=*arc*|*star*|*pipe*|*ball*|*flip*|*mixer*|*caret*|*bar1~3*]<br>
|
||||
`wait` *commands* [`--time`=interval] [`--log`=file] [`--format`=format] [`--help`]
|
||||
|
||||
## DESCRIPTION
|
||||
|
||||
Run *commands* in the background and wait until the job has finished. Any output to standard error indicates `wait` to return `1`. While it waits, a customizable spinner is displayed in the command line.
|
||||
|
||||
## OPTIONS
|
||||
|
||||
* `-s --spin=style|string`:
|
||||
Set the spinner style. See `Styles` for styles and details on how to customize the spinner tokens.
|
||||
|
||||
* `-t --time=interval`:
|
||||
Set spinner transition time delay in *seconds*. A large value will refresh the spinner more slowly. You may use decimal numbers to represent smaller numbers. The default interval is `0.02`.
|
||||
|
||||
* `-l --log=file`:
|
||||
Write the standard error output to a given *file*.
|
||||
|
||||
* `-f --format=format`:
|
||||
Use the given *format* to display the spinner. The default format is `"\r@"` where `@` represents the spinner token and `\r` a carriage return, used to refresh (erase) the line.
|
||||
|
||||
* `-h --help`:
|
||||
Show usage help.
|
||||
|
||||
## STYLES
|
||||
|
||||
* arc, star, pipe, ball, flip, mixer, caret
|
||||
* bar1~3
|
||||
|
||||
If no style is given, `mixer` is used by default. If you don't want to display any spinners, use `--spin=""`.
|
||||
|
||||
### CUSTOMIZATION
|
||||
|
||||
In addition to the default styles, you can specify a string of character tokens to be used each per spinner refresh cycle.
|
||||
|
||||
For example `--spin=12345` will display the numbers from 1 to 5, and `--spin=. --format=@` an increasing sequence of dots.
|
||||
|
||||
### PROGRESS BARS
|
||||
|
||||
Display a progress bar with a percent indicator using `--spin=bar1~3`:
|
||||
|
||||
* bar1: [=====] *num*%
|
||||
* bar2: [#####] *num*%
|
||||
* bar3: ....... *num*%
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
Run commands in the background and display a spinning pipe while until finished.
|
||||
|
||||
```
|
||||
wait --spin=pipe "curl -sS $URL"
|
||||
```
|
||||
|
||||
Write the standard error output to *debug.txt*.
|
||||
|
||||
```
|
||||
if not wait --spin=pipe --log=debug.txt "curl -sS $URL"
|
||||
return 1
|
||||
end
|
||||
```
|
||||
|
||||
## SEE ALSO
|
||||
|
||||
sleep(1)<br>
|
@ -1 +1 @@
|
||||
functions -e __fisher_url_clone wait
|
||||
functions -e __fisher_url_clone spin
|
||||
|
@ -1,21 +0,0 @@
|
||||
test "$TESTNAME: Fail if no commands are given"
|
||||
1 = (
|
||||
wait
|
||||
echo $status
|
||||
)
|
||||
end
|
||||
|
||||
test "$TESTNAME - Fail if there is any output to standard error" (
|
||||
if not wait 'echo error >&2'
|
||||
echo ok
|
||||
end
|
||||
) = ok
|
||||
end
|
||||
|
||||
test "$TESTNAME - Run commands in the background"
|
||||
(wait "math 1 + 2") = 3
|
||||
end
|
||||
|
||||
test "$TESTNAME - Display help information"
|
||||
(wait -h | xargs) = "usage: wait <commands> [--spin=<style>] [--time=<delay>] [--log=<file>] [--format=<format>] [--help] -s --spin=<style> Set spinner style -t --time=<delay> Set spinner transition time delay -l --log=<file> Output standard error to <file> -f --format=<format> Use given <format> to display spinner -h --help Show usage help"
|
||||
end
|
Loading…
Reference in New Issue