fisher/completions/fisher.fish
Jorge Bucaran 692bb22db6 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.
2016-02-14 13:17:47 +09:00

52 lines
2.0 KiB
Fish

complete -xc fisher
complete -c fisher -n "__fish_use_subcommand" -s l -l list -d "List plugins enabled|disabled|cache|<file>"
complete -c fisher -n "__fish_use_subcommand" -s h -l help -d "Display help"
complete -c fisher -n "__fish_use_subcommand" -s v -l version -d "Show version information"
complete -c fisher -a "fisherman" -d "Update Fisherman" -n "__fish_seen_subcommand_from update"
complete -c fisher -a "\t" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "name" -d "Filter by name" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "url" -d "Filter by url" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "info" -d "Filter by info" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "author" -d "Filter by author" -n "__fish_seen_subcommand_from search"
complete -c fisher -l "tags" -d "Filter by tag/s" -n "__fish_seen_subcommand_from search"
set -l IFS ";"
for option in commands guides
fisher_help --$option=bare | sed -E 's/^ *([^ ]+) *(.*)/\1;\2/' | while read -l command info
if test $option = commands
complete -c fisher -n "__fish_use_subcommand" -a $command -d "$info"
fisher_help --usage=$command | __fisher_complete fisher $command
end
complete -c fisher -n "__fish_seen_subcommand_from help" -a $command -d "$info"
end
end
if test ! -e $fisher_cache/.index
exit
end
set -l plugins (
if test -s $fisher_file
__fisher_file < $fisher_file | __fisher_name
end
)
begin
awk -F '\n' -v RS='' -v OFS=';' '/^ *#/ { next } { print $1, $3 }' $fisher_cache/.index
__fisher_cache_list
end | sort -ut ';' -k1,1 | while read -l name info
if contains -- $name $plugins
complete -c fisher -n "__fish_seen_subcommand_from u update uninstall" -a "$name" -d "$info"
else
complete -c fisher -n "__fish_seen_subcommand_from i install" -a "$name" -d "$info"
end
end