Commit Graph

3630 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
01f239188d [zfs] Limit snapshots to spelled-out dataset
Use the `-d` parameter to `zfs list` to limit snapshots to the dataset
named in the current token being completed. Thanks to @Debilski for the
tip.

Closes #7472
2020-11-20 15:28:19 -06:00
Érico Rolim
31870e774a share/functions: account for the possibility of mktemp failure. 2020-11-14 15:57:42 +01:00
Érico Rolim
036ed36887 share/completions/ls: remove double whitespace.
Small typo in the description for one of the options.
2020-11-13 14:34:42 +01:00
Érico Rolim
943ead2598 share/completions: fix non-standard capitalization.
Use "Installed package" instead of "Installed Package".
2020-11-13 14:34:42 +01:00
Mahmoud Al-Qudsi
6bd4f52b0d [zfs] Optimize enumeration of snapshots
Only generate the list of snapshots when
a) the argument must be a snapshot and nothing else, or
b) the argument as typed contains a literal @, or
c) a snapshot is a valid completion and there is only one dataset
   matching the argument as entered.

Unfortunately, it seems the `zfs` command itself is extremely primitive
and doesn't support listing snapshots by dataset so when we need to
generate completions, we end up needing to enumerate all snapshots
(ever) across all datasets. I'd be very happy to be proven wrong, but I
think the only other way would be manually parse `zdb` output.

See #7472
2020-11-12 22:24:29 -06:00
Shawn LeMaster
e4b64448fa Don't assume $__fish_git_prompt_char_cleanstate is non-empty
This fixes the case where an empty "clean state" character
can cause a spurious space character at the end of the git prompt.
2020-11-10 18:55:15 +01:00
Shun Sakai
36337fc45d Add completions for julia 2020-11-09 00:41:38 +09:00
Ayooluwa Isaiah
ea1dffd53d Add support for copy and paste in WSL
- clip.exe is used to copy to the Windows clipboard
- There's no binary for pasting from the Windows clipboard so
  `Get-Clipboard` from powershell is used as a workaround. The
  superflous carriage return is stripped from the output.
2020-11-06 22:10:04 +01:00
Sean Wei
ca0f5686ff Fix typo 2020-10-31 13:27:05 +01:00
Jan-Jaap Korpershoek
4b74fbf1b7
Make mysql completions work with log-in (#7397)
Complete databases using credentials specified on the commandline.
2020-10-30 18:34:23 +01:00
Mahmoud Al-Qudsi
3471db51c8 [completions] Add completions for pidof
[ci skip]
2020-10-30 11:16:22 -05:00
Clément Martinez
5a0bc0a516 Add bluetoothctl completions 2020-10-30 16:38:26 +01:00
Akatsuki Rui
f73808a0fa
Add completions for homect (#7435)
systemd-homed control tool

based on the systemd v246.6-1 manpage
2020-10-30 04:25:54 +01:00
Akatsuki Rui
d9b39b0d51 hostnamectl.fish: new completion
systemd-hostnamed control tools
2020-10-28 19:38:45 +01:00
Akatsuki Rui
9910bdf07a coredumpctl.fish: new completion
systemd-coredump control tools
2020-10-28 19:38:45 +01:00
Akatsuki Rui
91d6e50ed8 bootctl.fish: new completion
systemd-boot control tools
2020-10-28 19:38:45 +01:00
Akatsuki Rui
745c2c6383 timedatectl.fish: add missing 2 commands
timesync-status
show-timesync

and some missing options
2020-10-28 19:38:45 +01:00
Fabian Homborg
0259b29a09 completions/cdh: Only shorten ~ if the token starts with one
Works around #4570

Also keep order like it always wanted.

[ci skip]
2020-10-28 18:18:06 +01:00
Mahmoud Al-Qudsi
c560240abc [zpool] Improve ZFS completions
Do not show devices already part of a zpool on calls to `zpool add`
and the converse.
2020-10-25 21:51:34 -05:00
Clément Martinez
cbc40842e2 Complete pipenv run 2020-10-25 17:18:42 -05:00
Fabian Homborg
4bfda47449 Bind ctrl-r to search history if the commandline isn't empty
This is super cheesy.

One of the most common feature requests we get is "control-r must
search", even tho just using history-search-backward via e.g. up-arrow
is perfectly capable. The only real difference is that ctrl-r search
in other shells allows editing the search term by default, while we
stop the history search and edit the new commandline in those cases.

So, since the major problem is muscle-memory on ctrl-r,
let's just use that!

This makes ctrl-r do nothing on empty commandlines, and do
history-search-backward otherwise, so the basic flow of "press ctrl-r
to start history search, enter your search term, press ctrl-r to cycle
through matches" just works (except the first ctrl-r is useless and it
doesn't show anything).

See #602.
2020-10-23 13:42:54 +02:00
Mahmoud Al-Qudsi
7990bd3046 [npm/yarn] Add support for namespaced packages
The regex previously in use did not allow for namespaced packages and
wouldn't match against things like @types/foo.
2020-10-21 22:26:52 -05:00
Johannes Altmanninger
943cf03d8e Only send the PID of the last process in a job to builtin fg
jobs -p %1 prints all processes in the first job.
fg is special because it only takes one argument.  Using the last process
in the pipeline works for the cases I can think of.

Fixes #7406
2020-10-18 19:36:48 +02:00
Johannes Altmanninger
b633b443ba fixup! completions/git: handle "1 .A" files 2020-10-17 07:45:22 +02:00
Johannes Altmanninger
14855de95a completions/git: handle "1 .A" files
Fixes #7403
[ci skip]
2020-10-16 22:11:01 +02:00
Fabian Homborg
2a6547dd7c completions/mysql: Complete database name
Gosh this interface is awful - we really really need to strip the
weird ascii table and the "Database" header.

[ci skip]
2020-10-12 19:50:20 +02:00
Mahmoud Al-Qudsi
3f0e2ef1dc [openssl] Support openssl 1.1.0 completions 2020-10-10 11:53:57 -05:00
Johannes Altmanninger
863b4700f8 Use builtin command in spago completions, add to changelog 2020-10-10 13:11:53 +02:00
matoruru
d544cda937 Add completions/spago.fish 2020-10-10 13:07:27 +02:00
Johannes Altmanninger
f20e8e5860 alias: don't add --wraps for wrappers with the same name
These aliases seem to be common, see #7389 and others.  This prevents
recursion on that example, so `alias ssh "env TERM=screen ssh"` will just
have the same completions as ssh.

Checking the last token is a heuristic which hopefully works for most
cases. Users are encouraged to use functions instead of aliases.
2020-10-10 09:24:49 +02:00
Johannes Altmanninger
03e0ec82af alias: use original body instead of escaping back and forth 2020-10-10 09:24:49 +02:00
Johannes Altmanninger
a635d78976 competions/env: only invoke subcommand completions once
This prevents a seemingly infinite loop in
fish -c 'alias ssh "env ssh"; complete -C "ssh "'

It still prints "maximum recursion depth exceeded", but a follow-up commit
will work around that.

Fixes #7389
2020-10-10 09:24:49 +02:00
Johannes Altmanninger
f917211f3b completions/ssh: history --max=n might be better than head -n 2020-10-10 09:24:49 +02:00
Johannes Altmanninger
1173e8bda4 Clarify that some complete calls just need a command with no user-defined completion 2020-10-10 09:24:49 +02:00
Fabian Homborg
fb57ca8791 __fish_apropos: Use macOS' stat explicitly
Overrides the GNU tools some people use.

Fixes #7390.
2020-10-09 18:58:35 +02:00
Fabian Homborg
468c6ff0f8 abbr: Erase all abbrs in one go
Simplifies returns, also allows erroring out without erasing anything
if an abbr name was bogus
2020-10-04 12:34:51 +02:00
Fabian Homborg
420fa68c54 abbr: Fix check for spaces in the name
This used a non-existent variable
2020-10-04 12:34:51 +02:00
Fabian Homborg
135c5a9746 abbr: Don't write an error if erasing nonexisting abbrs
Fixes #7376.
2020-10-04 12:34:38 +02:00
Fabian Homborg
2ab4c10c47 abbr: Allow erasing multiple
Fixes #7377.
2020-10-04 12:27:59 +02:00
Joni Salmi
f845f267bd umount.fish Add long flags and fix long description in completion #6981 2020-10-03 17:16:39 -07:00
ridiculousfish
a6686ca310 Run makewhatis in the background
In the new __fish_apropos, makewhatis is run explicitly to generate the
whatis database. However this can be a little slow. Run it in the
background, after the apropos call completes so as to avoid a weird
race.

This means that descriptions may not be available the first time the
user invokes it, but that's better than appearing to hang for a while.
2020-10-03 17:09:00 -07:00
Folke Lemaitre
a6a0d43c9c Better __fish_describe_command for Macos
override MANPATH used by apropos with local whatis database and update it once a day

get rid of xargs

Created __fish_apropos and fixed __fish_complete_man to use that as well

moved macos apropos comment
2020-10-03 16:18:44 -07:00
Johannes Altmanninger
a1fd9e1b85 Fix invalid flags for builtin type
This combination of flags doesn't work anymore, which makes sense.
2020-09-30 21:46:43 +02:00
Johannes Altmanninger
f758d39535 string pad: handle padding characters of width > 1
If the padding is not divisible by the char's width without remainder,
we pad the remainder with spaces, so the total width of the output is correct.

Also add completions, changelog entry, adjust documentation, add examples
with emoji and some tests.  Apply some minor style nitpicks and avoid extra
allocations of the input strings.
2020-09-27 21:59:15 +02:00
Johannes Altmanninger
46746b4b26 completions/git: offer commit ranges for range-diff
A match made in heaven!
2020-09-27 21:59:15 +02:00
Johannes Altmanninger
e9582c41b2 Remove __fish_complete_external_command
It's no longer used.
2020-09-25 19:33:01 +02:00
Johannes Altmanninger
618705285d completions/git: support ... range notation
https://git-scm.com/docs/gitrevisions#_revision_range_summary
2020-09-25 19:33:01 +02:00
Johannes Altmanninger
2a95b283ee completions/git: complete only right commit if cursor is beyond the ".."
This enables completion for the right part of a range in many cases, like
`git log HEAD~10..`.
2020-09-25 19:33:01 +02:00
Fabian Homborg
293a3a628d Remove pipestatus_with_signal
This was a wrapper around status_to_signal, just because that only
handled a single argument.

Instead, just teach status_to_signal to handle multiple arguments and
be done.
2020-09-24 20:14:10 +02:00
Fabian Homborg
dde8318e50 print_pipestatus: Simplify
Just some minor stylistic nits
2020-09-24 20:08:16 +02:00