Using bare vars is more efficient because it makes the builtin `math`
expression cache more useful. That's because if you prefix each var with
a dollar-sign then the fish parser expands it before `math` is run.
Something like `math x + 1` can be cached since the expression is the
same each time it is run. But if you do `math $x + 1` and x==1 then you're
effectively executing `math 1 + 1`. And if x==2 the next time then you're
running `math 2 + 1`. Which makes the expression cache much less effective.
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.
* use $XDG_CACHE_HOME for __fish_print_packages completion caches
* when starting fishd, redirect fishd output to /dev/null, not a
predictable path
Fix for CVE-2014-3219.
Closes#1440.
Closes#479 by piping STDERR to /dev/null.
Also does much less manipulation of the package list; there are no
packages in any of the archives containing the names that are stripped
out as far as I can see.
* Added FreeBSD's pkg to __fish_print_packages
* Portmaster completes on installed packages and ports
* Options list as per fish_generate_completions, needs to be tidied
up further but will suffice for now
On Gentoo the eix program is MUCH faster than emerge for listing package
names. I've left the emerge code in as a 2nd choice because not every
Gentoo system has eix installed (although they should). Also, the
emerge code didn't seem to produce any output on my system.
Signed-off-by: Grissiom <chaos.proton@gmail.com>