fish: allow arguments to functions #1063
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This allows the ability to provide arguments to a function, such as
--on-event
in order to trigger a function on thefish_command_not_found
event, for example.The main reason for this was so that I could change
__fish_command_not_found_handler
because, on Arch, it looks for anypackages that might contain the misspelled binary. Previously, you might
have been able to get away with a hack like specifying the flags in the
function name, but now all you need to do is specify the submodule and
desired flags.
I added a test and news for this, but is there any better way to
document the available options? As it stands, I believe any interested
parties would need to browse the source to find out what is available
and what isn't.
I formatted themapAttrs'
block withnixfmt
, but it looks reallyugly. I left as-is because the fish module hasn't been blacklisted in
the format script yet, but it would look better if I went back and
manually formatted it.
Finally, please let me know if anything is not ideal, or is bad Nix, or
whatever. I'm still new to the language and stumbling around, but
interested in becoming more comfortable with it.
(Special thanks to @d-goldin for pointing me in the right direction)