mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-03 15:40:27 +00:00
One more push before 0.8.0, fixed bugs, paved the way for DEBUG mode.
* Add Mizuki to THANKS for help with Japanese translation of the QuickStart Guide. * fisher --list should return 1 (fail) if no plugins are installed. Closes #101. * More consistent style 'Usage' instead of 'usage'. * Silence index check in case $fisher_cache/.index does not exist. * Add more descriptive message if plugin is not found. * Silence search failure in case $fisher_cache/.index does not exist.
This commit is contained in:
parent
692bb22db6
commit
68beef51e9
17
THANKS.md
17
THANKS.md
@ -1,12 +1,11 @@
|
||||
# Thank You
|
||||
|
||||
The following individuals have contributed to Fisherman.
|
||||
The following individuals have contributed to Fisherman. :heart:
|
||||
|
||||
* Daniel Perez @tuvistavie
|
||||
* Daniele Sluijters @daenney
|
||||
* Hyeon Kim @simnalamburt
|
||||
* Ian @ViViDboarder
|
||||
* Jorge Bucaran @bucaran
|
||||
* Kevin Ballard @kballard
|
||||
|
||||
:heart:
|
||||
* [Daniel Perez](https://github.com/tuvistavie)
|
||||
* [Daniele Sluijters](https://github.com/daenney)
|
||||
* [Hyeon Kim](https://github.com/simnalamburt)
|
||||
* [Ian](https://github.com/ViViDboarder)
|
||||
* [Jorge Bucaran](https://github.com/bucaran)
|
||||
* [Kevin Ballard](https://github.com/kballard)
|
||||
* [Mizuki Fujiwara](https://github.com/zukif)
|
||||
|
@ -27,10 +27,6 @@ for option in commands guides
|
||||
end
|
||||
end
|
||||
|
||||
if test ! -e $fisher_cache/.index
|
||||
exit
|
||||
end
|
||||
|
||||
set -l plugins (
|
||||
if test -s $fisher_file
|
||||
__fisher_file < $fisher_file | __fisher_name
|
||||
@ -38,7 +34,12 @@ set -l plugins (
|
||||
)
|
||||
|
||||
begin
|
||||
awk -F '\n' -v RS='' -v OFS=';' '/^ *#/ { next } { print $1, $3 }' $fisher_cache/.index
|
||||
awk -F '\n' -v RS='' -v OFS=';' '
|
||||
|
||||
/^ *#/ { next } { print $1, $3 }
|
||||
|
||||
' $fisher_cache/.index ^ /dev/null
|
||||
|
||||
__fisher_cache_list
|
||||
|
||||
end | sort -ut ';' -k1,1 | while read -l name info
|
||||
@ -48,4 +49,5 @@ end | sort -ut ';' -k1,1 | while read -l name info
|
||||
else
|
||||
complete -c fisher -n "__fish_seen_subcommand_from i install" -a "$name" -d "$info"
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -10,13 +10,19 @@ function __fisher_list -a source
|
||||
|
||||
case "" all cache
|
||||
set -l enabled (__fisher_list $fisher_file)
|
||||
set -l cache (__fisher_cache_list)
|
||||
|
||||
if test -z "$cache"
|
||||
return 1
|
||||
end
|
||||
|
||||
set -l legend " "
|
||||
|
||||
if test -z "$enabled"
|
||||
set legend ""
|
||||
end
|
||||
|
||||
for i in (__fisher_cache_list)
|
||||
for i in $cache
|
||||
if contains -- $i $enabled
|
||||
if test $i = "$fisher_prompt"
|
||||
printf "%s%s\n" ">" $i
|
||||
|
@ -59,9 +59,7 @@ function fisher -d "Fish Plugin Manager"
|
||||
eval "fisher_$value" (printf "%s\n" "'"$argv"'")
|
||||
|
||||
case list
|
||||
if not __fisher_list $value
|
||||
return 1
|
||||
end
|
||||
__fisher_list $value
|
||||
|
||||
case version
|
||||
sed 's/^/fisher version /;q' $fisher_home/VERSION
|
||||
@ -71,7 +69,7 @@ function fisher -d "Fish Plugin Manager"
|
||||
set value commands
|
||||
end
|
||||
|
||||
printf "usage: fisher <command> [<args>] [--list] [--version] [--help]\n\n"
|
||||
printf "Usage: fisher <command> [<args>] [--list] [--version] [--help]\n\n"
|
||||
|
||||
switch commands
|
||||
case $value
|
||||
|
@ -33,7 +33,7 @@ function fisher_help -d "Show Help"
|
||||
set option help
|
||||
|
||||
case h
|
||||
printf "usage: fisher help [<keyword>] [--all] [--guides] [--help]\n\n"
|
||||
printf "Usage: fisher help [<keyword>] [--all] [--guides] [--help]\n\n"
|
||||
|
||||
printf " -a --all List available documentation\n"
|
||||
printf " -g --guides List available guides\n"
|
||||
|
@ -17,7 +17,7 @@ function fisher_install -d "Install Plugins"
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "usage: fisher install [<plugins>] [--force] [--quiet] [--help]\n\n"
|
||||
printf "Usage: fisher install [<plugins>] [--force] [--quiet] [--help]\n\n"
|
||||
|
||||
printf " -f --force Reinstall given plugin/s\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
@ -72,7 +72,7 @@ function fisher_install -d "Install Plugins"
|
||||
|
||||
else
|
||||
set total (math $total - 1)
|
||||
printf "fisher: '%s' not found.\n" $item > $stderr
|
||||
printf "fisher: '%s' not found or index out of date.\n" $item > $stderr
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -61,7 +61,7 @@ function fisher_search -d "Search Plugins"
|
||||
set quiet 1
|
||||
|
||||
case h
|
||||
printf "usage: fisher search [<plugins>] [--and|--or] [--quiet] [--help]\n\n"
|
||||
printf "Usage: fisher search [<plugins>] [--and|--or] [--quiet] [--help]\n\n"
|
||||
|
||||
printf " *--<field> Filter by url, name, info, author or tags\n"
|
||||
printf " -o --or Join query with OR operator\n"
|
||||
@ -135,7 +135,7 @@ function fisher_search -d "Search Plugins"
|
||||
author = \$5
|
||||
}
|
||||
|
||||
$query { print $fields } " $index | awk -v quiet=$quiet '
|
||||
$query { print $fields } " $index ^ /dev/null | awk -v quiet=$quiet '
|
||||
|
||||
!/^ *$/ { hasRecords = 1 } {
|
||||
if (quiet) {
|
||||
|
@ -17,7 +17,7 @@ function fisher_uninstall -d "Uninstall Plugins"
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "usage: fisher uninstall [<plugins>] [--force] [--quiet] [--help]\n\n"
|
||||
printf "Usage: fisher uninstall [<plugins>] [--force] [--quiet] [--help]\n\n"
|
||||
|
||||
printf " -f --force Delete copy from cache\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
|
@ -18,7 +18,7 @@ function fisher_update -d "Update Plugins/Fisherman"
|
||||
set stderr /dev/null
|
||||
|
||||
case h
|
||||
printf "usage: fisher update [<plugins>] [--quiet] [--help]\n\n"
|
||||
printf "Usage: fisher update [<plugins>] [--quiet] [--help]\n\n"
|
||||
printf " -q --quiet Enable quiet mode\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
|
@ -106,7 +106,7 @@ function fish
|
||||
set flags $flags $value
|
||||
|
||||
case h help
|
||||
printf "usage: $_ [OPTIONS] [\-c command] [FILE [ARGUMENTS\.\.\.]]\en"
|
||||
printf "Usage: $_ [OPTIONS] [\-c command] [FILE [ARGUMENTS\.\.\.]]\en"
|
||||
return
|
||||
|
||||
case \e*
|
||||
|
@ -78,7 +78,7 @@ function fish
|
||||
set flags $flags $value
|
||||
|
||||
case h help
|
||||
printf "usage: $_ [OPTIONS] [-c command] [FILE [ARGUMENTS...]]\n"
|
||||
printf "Usage: $_ [OPTIONS] [-c command] [FILE [ARGUMENTS...]]\n"
|
||||
return
|
||||
|
||||
case \*
|
||||
|
@ -79,7 +79,7 @@ The following example implements a command to retrieve plugin information and fo
|
||||
function fisher_info \-d "Display information about plugins"
|
||||
switch "$argv"
|
||||
case \-h \-\-help
|
||||
printf "usage: fisher info name | URL [\.\.\.]\en\en"
|
||||
printf "Usage: fisher info name | URL [\.\.\.]\en\en"
|
||||
printf " \-h \-\-help Show usage help\en"
|
||||
return
|
||||
end
|
||||
|
@ -46,7 +46,7 @@ The following example implements a command to retrieve plugin information and fo
|
||||
function fisher_info -d "Display information about plugins"
|
||||
switch "$argv"
|
||||
case -h --help
|
||||
printf "usage: fisher info name | URL [...]\n\n"
|
||||
printf "Usage: fisher info name | URL [...]\n\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
end
|
||||
|
@ -109,7 +109,7 @@ cat > wtc\.fish
|
||||
function wtc \-d "Generate a random commit message"
|
||||
switch "$argv"
|
||||
case \-h \-\-help
|
||||
printf "usage: wtc [\-\-help]\en\en"
|
||||
printf "Usage: wtc [\-\-help]\en\en"
|
||||
printf " \-h \-\-help Show usage help\en"
|
||||
return
|
||||
end
|
||||
|
@ -71,7 +71,7 @@ cat > wtc.fish
|
||||
function wtc -d "Generate a random commit message"
|
||||
switch "$argv"
|
||||
case -h --help
|
||||
printf "usage: wtc [--help]\n\n"
|
||||
printf "Usage: wtc [--help]\n\n"
|
||||
printf " -h --help Show usage help\n"
|
||||
return
|
||||
end
|
||||
|
@ -5,7 +5,7 @@ function -S setup
|
||||
|
||||
function fisher_$mock_command
|
||||
if not set -q argv[1]
|
||||
echo usage:...
|
||||
echo Usage:...
|
||||
return 1
|
||||
end
|
||||
awk $argv
|
||||
@ -17,7 +17,7 @@ function -S teardown
|
||||
end
|
||||
|
||||
test "$TESTNAME - Evaluate `fisher_' (sub) commands"
|
||||
(fisher $mock_command) = usage:...
|
||||
(fisher $mock_command) = Usage:...
|
||||
end
|
||||
|
||||
test "$TESTNAME - Commands can read standard input"
|
||||
@ -33,7 +33,7 @@ test "$TESTNAME - Handle \$fisher_alias aliases"
|
||||
end
|
||||
|
||||
test "$TESTNAME - Display usage help"
|
||||
(fisher | sed 1q) = "usage: fisher <command> [<args>] [--list] [--version] [--help]"
|
||||
(fisher | sed 1q) = "Usage: fisher <command> [<args>] [--list] [--version] [--help]"
|
||||
end
|
||||
|
||||
test "$TESTNAME - Display basic information about using the `help' command by default"
|
||||
|
10
test/fixtures/help/usage.txt
vendored
10
test/fixtures/help/usage.txt
vendored
@ -1,25 +1,25 @@
|
||||
usage: fisher update [<plugins>] [--quiet] [--help]
|
||||
Usage: fisher update [<plugins>] [--quiet] [--help]
|
||||
|
||||
-q --quiet Enable quiet mode
|
||||
-h --help Show usage help
|
||||
usage: fisher uninstall [<plugins>] [--force] [--quiet] [--help]
|
||||
Usage: fisher uninstall [<plugins>] [--force] [--quiet] [--help]
|
||||
|
||||
-f --force Delete copy from cache
|
||||
-q --quiet Enable quiet mode
|
||||
-h --help Show usage help
|
||||
usage: fisher search [<plugins>] [--and|--or] [--quiet] [--help]
|
||||
Usage: fisher search [<plugins>] [--and|--or] [--quiet] [--help]
|
||||
|
||||
*--<field> Filter by url, name, info, author or tags
|
||||
-o --or Join query with OR operator
|
||||
-a --and Join query with AND operator
|
||||
-q --quiet Enable quiet mode
|
||||
-h --help Show usage help
|
||||
usage: fisher install [<plugins>] [--force] [--quiet] [--help]
|
||||
Usage: fisher install [<plugins>] [--force] [--quiet] [--help]
|
||||
|
||||
-f --force Reinstall given plugin/s
|
||||
-q --quiet Enable quiet mode
|
||||
-h --help Show usage help
|
||||
usage: fisher help [<keyword>] [--all] [--guides] [--help]
|
||||
Usage: fisher help [<keyword>] [--all] [--guides] [--help]
|
||||
|
||||
-a --all List available documentation
|
||||
-g --guides List available guides
|
||||
|
@ -1,7 +1,7 @@
|
||||
function -S setup
|
||||
function foo
|
||||
printf "%s\n" "usage: foo [options] ..."
|
||||
printf "%s\n" "options:"
|
||||
printf "%s\n" "Usage foo [options] ..."
|
||||
printf "%s\n" "Options:"
|
||||
printf "%s\n" " --version Show version"
|
||||
printf "%s\n" " -h --help Show help"
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user