Commit Graph

14 Commits

Author SHA1 Message Date
Fabian Boehm
c39780fefb __fish_complete_directories: Remove --foo= from token
Otherwise this would complete

`git --exec-path=foo`, by running `complete -C"'' --exec-path=foo"`,

which would print "--exec-path=foo", and so it would end as

`git --exec-path=--exec-path=foo` because the "replaces token" bit was
lost.

I'm not sure how to solve it cleanly - maybe an additional option to
`complete`?

Anyway, for now this
Fixes #9538.
2023-03-27 22:57:34 +02:00
Fabian Boehm
200095998a __fish_complete_directories: Use an empty command as the dummy
Fixes #9574
2023-02-14 17:09:58 +01:00
Fabian Homborg
a3e20a4d38 Don't use abbreviated long options
"function --argument" is not a thing, it's "--argument-names". This only
accidentally works because our getopt is awful and allows abbreviated
long options.

Similarly, one argparse test used "--d" instead of "-d" or "--def".
2020-09-19 11:47:41 +02:00
Fabian Homborg
9367d4ff71 Reindent functions to remove useless quotes
This does not include checks/function.fish because that currently
includes a "; end" in a message that indent would remove, breaking the test.
2020-03-09 19:46:43 +01:00
Jason Nader
b4626468ec completion helper functions: do not use gettext
remove package
2020-03-06 22:23:50 +01:00
Fabian Homborg
dcf017ff57 fish_complete_directories: Use complete -C
This way we use our core file completion code, which is much more
flexible than we can easily achieve directly in script (which would
require e.g. an `expand` builtin, and case-insensitive globs).

Fixes #5896.
2019-05-27 19:33:52 +02:00
Mahmoud Al-Qudsi
beac145e75 Support expansions in directory completions as well
Also fixes some issues with duplicate results in __fish_complete_suffix.
2018-05-20 12:30:07 -05:00
Mahmoud Al-Qudsi
5f1168002e Complete current commandline token with __fish_complete_directories if
Akin to __fish_complete_suffix, __fish_complete_directories now attempts
to complete the current commandline token if no token is explicitly
passed in as an argument.
2018-05-12 14:06:03 -05:00
Kurtis Rader
5ef8b91db8 fix three explicitly translated messages 2017-06-02 20:40:58 -07:00
Kurtis Rader
da09a915f2 improve __fish_complete_directories function
Reviewing a PR for a completion script caused me to look at the
implementation for the `__fish_complete_directories` function. Which in
turn lead me to create this change to improve its implementation and add
unit tests for the function.
2017-04-11 13:45:53 -07:00
Kurtis Rader
11a60c8374 reformat all fish scripts
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.
2016-11-27 21:27:22 -08:00
liljencrantz
61ebc12dd4 Minor polish like adding missing whitespace, switch to using --argument switch in function definitions to make code more readable, add a few minor saftey checks, etc.
darcs-hash:20070923210730-75c98-88557ba8b6020cae04a5e437c6bb6370e39c04d9.gz
2007-09-24 07:07:30 +10:00
axel
6c8a559023 Drop unneeded '--' when using set builtin in various places
darcs-hash:20061212203727-ac50b-23fbb54bba0c5773e8a3dd2e5737ea8a670c801d.gz
2006-12-13 06:37:27 +10:00
axel
8b73bac580 Rename __fish_complete_directory to increase consistency
darcs-hash:20061202233433-ac50b-48368a338773ad47807b0032389fd305d86b3275.gz
2006-12-03 09:34:33 +10:00