mirror of
https://github.com/jorgebucaran/fisher
synced 2024-11-03 15:40:27 +00:00
ee0338d5b0
This patch contains several amends for 0.3.0 and other minor documentation corrections. Major documentation revision and rewrite. fisher help shows fisher(1) by default now. Fix a critical bug that was causing fisher uninstall --force to remove not the symbolic link, but the actual files. Closes #24 Rename orphan tag to custom for plugins installed using a custom URL. warning Remove fisher --link flag and create symbolic links by default for local paths. The user does not have to worry about symbolic links or whether the copy is as symbolic link or not anymore. If the user tries to install a local path, then the best thing to do is to create a symbolic link. This also eliminates the need to call update. warning Remove fisher --cache and fisher --validate. Now, that these options are separated into their own function and they are intentionally private, there is no need for them.
117 lines
3.2 KiB
Fish
117 lines
3.2 KiB
Fish
function fisher_help -d "Show Help"
|
|
if not set -q argv[1]
|
|
man fisher
|
|
return 1
|
|
end
|
|
|
|
set -l option
|
|
set -l value
|
|
|
|
getopts $argv | while read -l 1 2
|
|
switch "$1"
|
|
case _
|
|
set option manual
|
|
set value $2
|
|
|
|
case a all
|
|
set option guides commands
|
|
set value $2
|
|
|
|
case g guides
|
|
set option $option guides
|
|
set value $2
|
|
|
|
case commands
|
|
set option $option commands
|
|
set value $2
|
|
|
|
case u usage
|
|
set option usage
|
|
set value $value $2
|
|
|
|
case help
|
|
set option help
|
|
|
|
case h
|
|
printf "usage: fisher help [<keyword>] [--all] [--guides] [--help]\n\n"
|
|
|
|
printf " -a --all List available documentation \n"
|
|
printf " -g --guides List available guides \n"
|
|
printf " -u --usage[=<cmd>] Display command usage \n"
|
|
printf " -h --help Show usage help \n"
|
|
return
|
|
|
|
case \*
|
|
printf "fisher: Ahoy! '%s' is not a valid option\n" $1 >& 2
|
|
fisher_help --help >& 2
|
|
return 1
|
|
end
|
|
end
|
|
|
|
if not set -q option[1]
|
|
set option commands
|
|
end
|
|
|
|
switch "$option"
|
|
case help
|
|
fisher help help
|
|
|
|
case manual
|
|
switch "$value"
|
|
case fisherman fisher-7 7-fisher
|
|
man 7 fisher
|
|
|
|
case fisher me
|
|
man fisher
|
|
|
|
case \*
|
|
man fisher-$value
|
|
end
|
|
|
|
case usage
|
|
if test -z "$value"
|
|
sed -E 's/^ *([^ ]+).*/\1/' | while read -l value
|
|
if functions -q fisher_$value
|
|
fisher $value -h
|
|
end
|
|
end
|
|
else
|
|
printf "%s\n" $value | fisher_help --usage
|
|
end
|
|
|
|
case \*
|
|
switch "$value"
|
|
case bare
|
|
case \*
|
|
fisher --help=$option
|
|
return
|
|
end
|
|
|
|
switch commands
|
|
case $option
|
|
functions -a | grep '^fisher_[^_]*$' | while read -l f
|
|
functions $f | awk '
|
|
/^$/ { next }
|
|
{
|
|
printf(" %s\t", substr($2, 8))
|
|
gsub("\'","")
|
|
|
|
for (i=4; i<=NF && $i!~/^--.*/; i++) {
|
|
printf("%s ", $i)
|
|
}
|
|
|
|
print ""
|
|
exit
|
|
}'
|
|
end | column -ts\t
|
|
end
|
|
|
|
switch guides
|
|
case $option
|
|
sed -nE 's/(fisher-)?(.+)\([0-9]\) -- (.+)/ \2'\t'\3/p' \
|
|
{$fisher_home,$fisher_config}/man/man{5,7}/fisher*.md | sort -r
|
|
|
|
end | column -ts\t
|
|
end
|
|
end
|