override MANPATH used by apropos with local whatis database and update it once a day
get rid of xargs
Created __fish_apropos and fixed __fish_complete_man to use that as well
moved macos apropos comment
New fish_indent does that too, so this will make any future reformatting
diffs smaller.
Done using either of:
perl -pi -e 'undef $/; s/\n*$/\n/' share/**.fish
kak -n -f '<a-/>\n*<ret>d' share/**.fish
This reverts commit 535845861a.
That commit introduced a bug where tab-completing commands no longer
prints their descriptions, unless there is an exact match.
Mimic the behavior of Linux's `apropos -e` and ~BSD's `apropos -f` with
the awk script by disallowing trailing characters in the name of the
manpage as compared to the original input string. Apart from being
faster (by aborting earlier and stopping `apropos` by breaking the pipe
after the first match), it's also more correct.
It's now good enough to do so.
We don't allow grid-alignment:
```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z -a '(something)'
```
becomes
```fish
complete -c foo -s b -l barnanana -a '(something)'
complete -c foo -s z -a '(something)'
```
It's just more trouble than it is worth.
The one part I'd change:
We align and/or'd parts of an if-condition with the in-block code:
```fish
if true
and false
dosomething
end
```
becomes
```fish
if true
and false
dosomething
end
```
but it's not used terribly much and if we ever fix it we can just
reindent.
We just do a cheesy version check and hope it works out.
If this is fixed in 10.15.4, we have to reenable it. If it still isn't
fixed in 10.16, we need to adjust it.
Fixes#6270
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python.
If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
Dealing with macOS output in a fast manner using `string` is surprisingly hard, given that it features lines like
gls(1), ls(1) - list directory contents
Printing the "gls" with the description and the "ls" with the description requires a `while read` loop, and that's too slow.
This reverts commit 7784a5f23c.
[ci skip]
Prior to this fix, __fish_describe_command would error if the
input contained any special characters, because it would be interpolated
into a regex. Hack in a guard to do nothing if the input contains
anything other than [a-zA-Z0-9_ ]
I hate doing this but I am tired of touching a fish script as part of
some change and having `make style` radically change it. Which makes
editing fish scripts more painful than it needs to be. It is time to do
a wholesale reformatting of these scripts to conform to the documented
style as implemented by the `fish_indent` program.