mirror of https://github.com/jorgebucaran/fisher
Add new __fisher_help_* functions.
Split help command functionality into individual functions for cosistent with the way other commands are structured, and improve tab completion times by skipping the overhead of calling fisher_help directly.pull/124/head
parent
a261f9b510
commit
81045ae342
@ -0,0 +1,20 @@
|
||||
function __fisher_help_commands
|
||||
for i in (functions -a | grep -E '^fisher_[^_]+$')
|
||||
functions $i | awk '
|
||||
|
||||
/^$/ { next } {
|
||||
printf("%s;", substr($2, 8))
|
||||
|
||||
gsub("\'", "")
|
||||
|
||||
for (i = 4; i <= NF && $i !~ /^--.*/; i++) {
|
||||
printf("%s ", $i)
|
||||
}
|
||||
|
||||
print ""
|
||||
exit
|
||||
}
|
||||
|
||||
'
|
||||
end
|
||||
end
|
@ -0,0 +1,4 @@
|
||||
function __fisher_help_guides
|
||||
sed -nE 's/(fisher-)?(.+)\([0-9]\) -- (.+)/\2;\3/p' \
|
||||
{$fisher_home,$fisher_config}/man/man{5,7}/fisher*.md | sort -r
|
||||
end
|
@ -0,0 +1,14 @@
|
||||
function __fisher_help_usage -a value
|
||||
if test -z "$value"
|
||||
set -e value
|
||||
sed -E 's/^ *([^ ]+).*/\1/' | while read -l command
|
||||
if functions -q fisher_$command
|
||||
set value $command $value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for command in $value
|
||||
fisher $command -h
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue