mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
time for another make style-all
Gotta keep the entropy (i.e., disorder) from increasing.
This commit is contained in:
@@ -28,43 +28,43 @@ function __fish_complete_man
|
||||
if test -n "$token"
|
||||
# Do the actual search
|
||||
apropos $token ^/dev/null | awk '
|
||||
BEGIN { FS="[\t ]- "; OFS="\t"; }
|
||||
# BSD/Darwin
|
||||
/^[^( \t]+\('$section'\)/ {
|
||||
split($1, pages, ", ");
|
||||
for (i in pages) {
|
||||
page = pages[i];
|
||||
sub(/[ \t]+/, "", page);
|
||||
paren = index(page, "(");
|
||||
name = substr(page, 1, paren - 1);
|
||||
sect = substr(page, paren + 1, length(page) - paren - 1);
|
||||
print name, sect ": " $2;
|
||||
}
|
||||
}
|
||||
# man-db
|
||||
/^[^( \t]+ +\('$section'\)/ {
|
||||
split($1, t, " ");
|
||||
sect = substr(t[2], 2, length(t[2]) - 2);
|
||||
print t[1], sect ": " $2;
|
||||
}
|
||||
# man-db RHEL 5 with [aliases]
|
||||
/^[^( \t]+ +\[.*\] +\('$section'\)/ {
|
||||
split($1, t, " ");
|
||||
sect = substr(t[3], 2, length(t[3]) - 2);
|
||||
print t[1], sect ": " $2;
|
||||
}
|
||||
# Solaris 11
|
||||
# Does not display descriptions
|
||||
# Solaris apropos outputs embedded backspace in descriptions
|
||||
/^[0-9]+\. [^( \t]*\('$section'\) / {
|
||||
split($1, t, " ")
|
||||
paren = index(t[2], "(");
|
||||
name = substr(t[2], 1, paren - 1);
|
||||
sect = substr(t[2], paren + 1, length(t[2]) - paren - 1);
|
||||
print name, sect
|
||||
}
|
||||
'
|
||||
|
||||
BEGIN { FS="[\t ]- "; OFS="\t"; }
|
||||
# BSD/Darwin
|
||||
/^[^( \t]+\('$section'\)/ {
|
||||
split($1, pages, ", ");
|
||||
for (i in pages) {
|
||||
page = pages[i];
|
||||
sub(/[ \t]+/, "", page);
|
||||
paren = index(page, "(");
|
||||
name = substr(page, 1, paren - 1);
|
||||
sect = substr(page, paren + 1, length(page) - paren - 1);
|
||||
print name, sect ": " $2;
|
||||
}
|
||||
}
|
||||
# man-db
|
||||
/^[^( \t]+ +\('$section'\)/ {
|
||||
split($1, t, " ");
|
||||
sect = substr(t[2], 2, length(t[2]) - 2);
|
||||
print t[1], sect ": " $2;
|
||||
}
|
||||
# man-db RHEL 5 with [aliases]
|
||||
/^[^( \t]+ +\[.*\] +\('$section'\)/ {
|
||||
split($1, t, " ");
|
||||
sect = substr(t[3], 2, length(t[3]) - 2);
|
||||
print t[1], sect ": " $2;
|
||||
}
|
||||
# Solaris 11
|
||||
# Does not display descriptions
|
||||
# Solaris apropos outputs embedded backspace in descriptions
|
||||
/^[0-9]+\. [^( \t]*\('$section'\) / {
|
||||
split($1, t, " ")
|
||||
paren = index(t[2], "(");
|
||||
name = substr(t[2], 1, paren - 1);
|
||||
sect = substr(t[2], paren + 1, length(t[2]) - paren - 1);
|
||||
print name, sect
|
||||
}
|
||||
'
|
||||
|
||||
# Fish commands are not given by apropos
|
||||
set -l files $__fish_datadir/man/man1/*.1
|
||||
string replace -r '.*/([^/]+)\.1$' '$1\tFish command' -- $files
|
||||
|
||||
Reference in New Issue
Block a user