fisher/functions/__fisher_list.fish
Jorge Bucaran 68beef51e9 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.
2016-02-15 21:24:22 +09:00

65 lines
1.6 KiB
Fish

function __fisher_list -a source
switch "$source"
case bare
__fisher_cache_list
case url
for i in (__fisher_cache_list)
__fisher_url_from_path $fisher_cache/$i
end
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 $cache
if contains -- $i $enabled
if test $i = "$fisher_prompt"
printf "%s%s\n" ">" $i
else if test -L $fisher_cache/$i
printf "%s%s\n" "@" $i
else
printf "%s%s\n" "*" $i
end
else
printf "%s%s\n" "$legend" $i
end
end
case enabled installed
__fisher_list $fisher_file
case disabled
set -l enabled (__fisher_list $fisher_file)
for name in (__fisher_cache_list)
if not contains -- $name $enabled
printf "%s\n" $name
end
end
case theme prompt
printf "%s\n" $fisher_prompt
case -
__fisher_file | __fisher_name
case \*
if test -s "$source"
__fisher_list - < $source
end
end
end