Commit graph

3182 commits

Author SHA1 Message Date
David Adam
45fb2024f8 completions: drop shebang from non-executable files
These completion files do not get marked as executable, so they don't
need a shebang.
2020-02-18 21:34:19 +08:00
Mahmoud Al-Qudsi
535845861a __fish_describe_command: print only exact match and exit
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.
2020-02-17 20:22:39 -06:00
Mahmoud Al-Qudsi
3c7019b335 __fish_describe_command: check for apropos only at startup 2020-02-17 20:13:39 -06:00
Mahmoud Al-Qudsi
5510443f48 __fish_describe_command: Remove regex escape hack 2020-02-17 20:13:30 -06:00
Fabian Homborg
65883e0e40 Restyle
Mostly line breaks, one instance of tabs!

For some reason clang-format insists on two spaces before a same-line comment?

(I continue to be unimpressed with super-strict line length limits,
but I continue to believe in automatic styling, so it is what it is)

[ci skip]
2020-02-17 14:14:05 +01:00
Jason Nader
a619f69b15 Rename functions to match others 2020-02-17 09:55:05 +01:00
Fabian Homborg
63b4a891ff completions/optipng: Add missing quote
Oops!

This should be in 3.1.1!

cc @zanchey
2020-02-17 08:57:41 +01:00
Fabian Homborg
96587d26f5 completions/rbenv: Fix error spew
Fixes #6617
2020-02-17 08:57:41 +01:00
Aaron Gyes
b1bbb58af6 Reword open completion descriptions, don't use sed
Fixes issue with (null) junk in -b completions
2020-02-14 14:45:23 -08:00
Fabian Homborg
56040d2d7f completions/npm: Allow files for "install"
Fixes #6596

[ci skip]
2020-02-14 17:57:07 +01:00
Maksim Novikov
682f4b04ad Include special characters in conda env names
Allows completion for environments with names containing special
characters. For example: my-env, myenv.1, myenv+1
2020-02-11 18:28:06 +01:00
Collin Styles
ea8a2b2dda Correct list-language to list-languages in bat completions 2020-02-10 21:38:59 +01:00
Johannes Altmanninger
8a033b9f3d Add undo
Add the input function undo which is bound to `\c_` (control + / on
some terminals). Redoing the most recent chain of undos is supported,
redo is bound to `\e/` for now.

Closes #1367.
This approach should not have the issues discussed in #5897.

Every single modification to the commandline can be undone individually,
except for adjacent single-character inserts, which are coalesced,
so they can be reverted with a single undo. Coalescing is not done for
space characters, so each word can be undone separately.

When moving between history search entries, only the current history
search entry is reachable via the undo history. This allows to go back
to the original search string with a single undo, or by pressing the
escape key.
Similarly, when moving between pager entries, only the most recent
selection in the pager can be undone.
2020-02-07 17:15:17 +01:00
Geoff Nixon
f7edfba5d7 Avoid apropos on macOS 10.15 with man completion
Same issue occurs here, as in #6270 (and fixed in 611a658 for `__fish_describe_command.fish`). Same reason. I've just copied the same workaround and changed the function name to match.
2020-02-07 20:52:39 +08:00
David Adam
43edbf4a91 config.fish: drop PATH modifications on Solaris-derived systems
Fixes #6556.

Although present since 2006, fish no longer relies on POSIX-compliant tools to the same degree. This
code causes a platform specific change that makes the tests fail, so remove it.
2020-02-07 20:43:15 +08:00
Jason Nader
fb00d6638e completions/apt: Add support for filename completions
Plus some small fixes.
Fixes #6209
[ci skip]
2020-02-06 02:17:38 +01:00
Johannes Altmanninger
5d135d5556 prompts: fix pipestatus for jobs prefixed with "not"
6902459566 was an attempt to not print
$status twice in the prompt. As a result we print $pipestatus but
not $status, which /usually/ is the same as $pipestatus[-1] --- unless
the builtin "not" is used, which inverts the $status of a job (it does
not alter $pipestatus).

As a result, the default prompt prints unexpected status codes:

	~ > not false
	~ [1]> not true
	~ > not true | true
	~ > not false | false
	~ [1|1]>

This commit reintroduces printing of $status after $pipestatus, but only
if it is different from $pipestatus[-1].
Additionally, we only print anything at all if the $status is nonzero,
to avoid confusing output on `not false | false`

	~ > not false
	~ > not true
	~ [0] 1> not true | true
	~ [0|0] 1> not false | false
	~ >

I think this is closer to users' expectations for those cases; they should
not have to think about this implementation detail of the not-statement.
2020-02-06 01:43:17 +01:00
Mahmoud Al-Qudsi
9bf5dfd738 Further enrich cargo completions
* Replace multiple calls to `tail` and `string` with a single `string
  replace` execution
* Dynamically generate list of available benches, bins, and tests for
  `--bench`, `--bin`, and `--test` switches

[ci skip]
2020-02-04 18:12:02 -06:00
Mahmoud Al-Qudsi
8f4797a38b Update cargo completions to use dynamic --example options
[ci skip]
2020-02-03 13:48:11 -06:00
Michael Sanders
3f8907d7cf Add pyenv completions 2020-01-30 21:53:45 -08:00
Michael Sanders
5c8ef19ff8 Bring rbenv completions up-to-date 2020-01-30 21:53:14 -08:00
Johannes Altmanninger
50e08dc3a0 add completions for wireshark/tshark/dumpcap 2020-01-30 16:45:02 +01:00
Johannes Sasongko
8e8a3846fb __fish_prepend_sudo: Don't move the relative position of the cursor
At the moment the "prepend sudo" functionality always sets the cursor to
the end of the line. This changes it to restore the relative position of
the cursor.
2020-01-29 09:21:23 +01:00
Jason Nader
7d89cadd58 Stringify vared completions 2020-01-26 13:53:45 +01:00
Fabian Homborg
23042b6a43 Remove unused "prefix" variable in prompt presets
[ci skip]
2020-01-26 12:29:06 +01:00
Jason
bcf2e2cdbd Remove unused variable 2020-01-26 12:28:01 +01:00
Jason Nader
3142ef6dbc Add interface label/name to the completions for -b 2020-01-26 12:26:47 +01:00
Jason Nader
b2969f4dfb Fix typo in mplayer completions 2020-01-25 08:36:15 +01:00
Jason Nader
5bfb6fef76 Stringify __fish_pwd.fish 2020-01-24 19:05:08 +01:00
Jason
2a247c7fe5 Stringify ssh completions (#6529)
* Stringify ssh completions

* Fix completions for `-b` option

* Fix completions for `-b` option
2020-01-24 18:29:17 +01:00
239
3e08083d49 Add completions for loginctl and resolvectl (#6501)
* Add completions for loginctl and resolvectl

* Add #6501

* Fix optional arguments

* Remove placeholder arguments
Fix expected arguments
2020-01-24 18:27:47 +01:00
Aaron Bieber
903fe9de48 webconfig: Use tempfile instead of ~/.cache (#6522)
OpenBSD uses [unveil(2)](https://man.openbsd.org/unveil) in chromium and
firefox. This means that things outside of directories like ~/Downloads or /tmp are not visible to the
browsers.

Change webconfig so it uses tempfile.NamedTemporaryFile to create our temp file.
2020-01-23 19:52:26 +01:00
Jason Nader
a5d625d389 Stringify j.fish 2020-01-22 17:43:18 +01:00
Jason Nader
2323a5629c Stringify netctl completions 2020-01-22 17:41:43 +01:00
Jason Nader
1cafc4eff6 Amend comments incorrectly referring to sed 2020-01-22 17:40:31 +01:00
Aaron Bieber
0918b537ac Get the list of VMs in a less fragile way. 2020-01-22 16:48:02 +01:00
Fabian Homborg
d61c188c3c Fix xdg mimetype completion
This hung when no file existed, and failed to properly find the
directories if they didn't end in a "/".

Fixes #6525

[good for 3.1.0]
2020-01-22 16:33:56 +01:00
Jason Nader
6fb545cf9b Stringify gpg completions 2020-01-21 17:57:57 +01:00
Jason Nader
13a26a1c65 Remove dropbox completions 2020-01-21 16:57:27 +01:00
Jason Nader
103a26ffb1 Fix function output on FreeBSD/Cygwin systems 2020-01-21 16:55:37 +01:00
Fabian Homborg
4e931fd967 completions/kill: Offer -SIGNAME
E.g. "kill -HUP".
2020-01-20 17:51:59 +01:00
Fabian Homborg
1480865d52 Stringify make_completion_signals 2020-01-20 17:51:59 +01:00
Fabian Homborg
acefa61e8b Hardcode signal names/numbers on cygwin
Work around weirdness in Cygwin's kill implementation.

Fixes #6469.
2020-01-20 17:51:59 +01:00
Jason Nader
f63ae0fb4d Add missing comment to bower.fish
Same comment found in yarn.fish
2020-01-20 19:45:21 +08:00
Fabian Homborg
0e5846ee38 completions/fish: Rename debug-level
This was renamed to just "--debug", but missed in the completions.

See #5910

[ci skip]
2020-01-19 13:28:21 +01:00
Fabian Homborg
d972623191 Fix vendor paths without $XDG_DATA_DIRS
We'd use $__fish_data_dir, but that already had the "/fish" component,
and then we'd add it again later, so we would try to find vendor
functions in places like

/usr/share/fish/fish/vendor_functions.d

which obviously don't exist.

Instead let's add the "/fish" component to the xdg dirs early, which
also saves us from having to repeat it later.

Fixes #6428
See #6508

[ci skip]
2020-01-19 09:28:56 +01:00
Shun Sakai
f04536637d Add keepassxc-cli completions 2020-01-18 12:27:04 -08:00
Greg Anders
e143618aef Set base16 colors for operator, escape, and match 2020-01-18 12:16:19 -08:00
Greg Anders
1331b32cce Add Base16 color options to fish_config 2020-01-18 12:16:19 -08:00
Shun Sakai
8c725c7d54 Add chronyc completions 2020-01-14 17:17:28 +01:00