This started out as a refactoring to eliminate the lint warnings. Adding
unit tests revealed the current implementation does not behave as
implied. So this is a complete rewrite of the implementation. With the
addition of unit tests so that it doesn't break in the future and anyone
who thinks this new version behaves wrong can update the unit tests to
help ensure we're testing for the correct behavior.
Fixes#4027
It still performs the assignment even if the command substitution
returned unsuccessfully - `set foo (echo bar; false)` returns 1 but
sets $foo to bar.
Also use `type -p` instead of `which`.
* Added Magento2 CLI completions
This is the completion file for the Magento2 CLI application I use on my servers. It has an additional feature tho, I'm not sure if it fits into the fish completion philosophy:
If you provide limited access credentials, it will connect to the MySQL database and provide additional suggestions, such as available users, themes or indexers in the database. If this file is never touched, those suggestions simply won't show up. I, personally, find them to be pretty useful, though.
Should I remove those database suggestions before creating a PR?
* Removed functions using MySQL, updated formatting
* Several smaller fixes
* Improved descriptions
Tried to shorten the text as much as possible and removed unnecessary characters
Some platforms do not correctly define `struct dirent` so that its
`d_name` member is long enough for the longest file name. Work around
such broken definitions.
Fixes#4030
The LRU cache wants to store references from nodes back into the
lookup map, so that it is efficient to remove a node from the
map. However certain compilers refuse to form a std::map::iterator
with an incomplete type. Fix this by storing a pointer to the key
instead of the iterator.
* Implement https://github.com/hanny24/gradle-fish/blob/master/gradle.load
* Use XDG_CACHE_HOME
* Use __funced_md5
* Fix fish_md5.fish
* Actually use the new function.
* Use string match for matching tasks
* I goofed. Actually pass a string to complete -a
* Fix attempt to remove needed function...
* Fix regex
* Fix fish_md5.fish to use a flag
Commit f10e4f8 causes some old compilers to complain about implicit
return from non-void function. A false positive error but make the
compiler happy so it stops complaining.
This suppresses lint warnings about using `getpwent()` because there is
only one context where fish uses it. Thus the fact it may not be thread
safe is not relevant to fish. This also improves that call site in
`completer_t::try_complete_user()` method by short-circuiting the loop
when a match is found.
The lint warning about possible problems using `flock()` to lock files
that I added isn't helpful and is just noise in the `make lint-all`
output. What we should do is is change to code to obviate the need for
file locking. But that's a big change for another day.
Another change related to issue #3985. I forgot to includes this in my
previous two changes related to to consistently returning status 121
when any command, not just `string`, is handed invalid args.
This changes all of the builtins to behave like `string` to return
STATUS_INVALID_ARGS (121) if the args passed to the command don't make
sense. Also change several of the builtins to use the existing symbols
(e.g., STATUS_CMD_OK and STATUS_CMD_ERROR) rather than hardcoded "0"
and "1" for consistency and to make it easier to find such values in
the future.
Fixes#3985
This primarily replaces "STATUS_BUILTIN_OK" with "STATUS_CMD_OK" and
"STATUS_BUILTIN_ERROR" with "STATUS_CMD_ERROR". That is because we want
to make it clear these status codes are applicable to fish functions as
well as builtins. Future changes will make it easier to use these
symbols and values in functions.
Working on a related problem caused me to notice that if a fish script
was run via `nohup` it would die when receiving SIGHUP. This fixes the
code to handle that correctly so that fish scripts can be nohup'd.
Fixes#4007
Per discussion in PR#3998 to review adding a `--filter` flag to `string
replace` rename the same flag in the `string match` subcommand to avoid
confusion about the meaning of the flag.