Commit graph

2104 commits

Author SHA1 Message Date
Aaron Gyes
a6ed9ace6a Add -ot, -nt, -ef to test completions
also complete filenames in binary cases

e.g. test path -ef path
2022-07-16 12:40:36 -07:00
Bagohart
ce6b122f7f added tab completions for choose 2022-07-16 21:40:02 +08:00
Bagohart
824ee5d70b added tab completions for navi 2022-07-16 21:36:12 +08:00
Aaron Gyes
a1dd93df41 Update touch completions for all the platforms
- Generally better descriptions,
- uname checks to not complerte unavailable options on
  NetBSD, FreeBSD, DragonFly, Solaris, Darwin
- Describe/complete GNU's --time=access,mtime... arg
- Remove -f it is a no-op and not documented.
2022-07-09 13:42:00 -07:00
Israel Chauca Fuentes
9e43e74723 Add completion for the "expect" command 2022-07-09 13:44:45 +02:00
Alexander M
8d57bc6a9a Fix long descriptions in gdb.fish
Work on #6981
2022-07-09 12:28:22 +02:00
Fabian Boehm
8082f8c056 completions/git: Use __fish_git
That's the one that silences stderr!
2022-07-03 09:42:37 +02:00
Kid
e6505d1c30 file completion nuances on macOS 2022-07-02 11:33:03 +02:00
Fabian Boehm
842af06c5d completions/git: Cache subcommand v2
This is sort of slow because it's called hundreds of times.

We used to have a cache, introduced in ad9b4290e, but it was removed
in fee5a9125a because it had
false-positives.

So what we do, because the issue is that this is called hundreds of
times per-commandline, we cache it keyed on the commandline.

This speeds up `complete -C'git sta'` by a factor of 2.3x.
2022-06-27 17:15:30 +02:00
Johannes Altmanninger
fee5a9125a Revert "completions/git: cache subcommand computation"
Commit ad9b4290e optimized git completions by adding a completion that would
run on every completion request, which allows to precompute data used by
other completion entries. Unfortunately, the completion entry is not run
when the commandline contains a flag like `git -C`. If we didn't
already load git.fish, we'd error. Additionally, we got false positive
completions for `git diff -c`.

So this hack was a very bad idea. We should optimize in another way.
2022-06-26 23:02:26 +02:00
Rocka
c588bd5c5c completions: add qdbus completion 2022-06-25 21:59:57 +02:00
NextAlone
5642499dc2
feat: completion for reflector (#9027)
* feat: completion for reflector

* fix
2022-06-25 21:59:18 +02:00
mhmdanas
9f19ab1fba Prioritize APKs for adb install 2022-06-25 12:03:22 -07:00
exploide
459bbe208d scp completions: added new options 2022-06-25 12:02:19 -07:00
Fabian Boehm
8f08fe80fd Restyle codebase
Not a lot of changes, tbh
2022-06-16 18:43:28 +02:00
Fabian Boehm
0bc524340c Fix rsync
Sorry!
2022-06-16 10:59:54 +02:00
Fabian Boehm
3e0bd0b7e1 Make rsync escaping version-dependent 2022-06-16 09:50:59 +02:00
Farid
f2b16a822e Fixed escaping in rsync completion 2022-06-16 09:50:38 +02:00
MidAutumnMoon
93eb8e9928 completions: zfs: fix for set subcmd 2022-06-15 20:48:08 +02:00
Fabian Boehm
b004635bc9 completions/git: Add some more options 2022-06-13 18:24:24 +02:00
David Adam
68f67ff46c git completions: make :/:-prefixed paths work everywhere on old git
git versions that only support porcelain v1 output (like on CentOS 7,
which has 1.8.3) weren't completing files prefixed with : correctly iff
the name after the colon was also a valid relative path.

Fixes the tests on CentOS 7.
2022-06-12 22:10:36 +08:00
Akatsuki Rui
bb158880d5 Add efibootmgr completion 2022-06-09 18:51:59 +02:00
Arash Mousavi
88502ca49f Add uninstall command to rbenv.fish completion
`uninstall` is part of the ruby-build.
2022-06-08 17:34:25 +02:00
David Adam
219a15d1db ip completions: fix case statements for show/save/flush
An errant end prevented the relevant section of the switch statement from being evaluated.

Fixes #9008.

Thanks to caoczy@github for the diagnosis.
2022-06-08 21:44:39 +08:00
Fabian Boehm
0ea6703661 completions/git: Terminate pathspec magic
Git's pathspec system is kind of annoying:

>  A pathspec that begins with a colon : has special meaning. In the short form, the leading colon : is followed by zero or more "magic signature" letters (which optionally is terminated by another colon :), and the remainder is the pattern to match against the path. The "magic signature" consists of ASCII symbols that are neither alphanumeric, glob, regex special characters nor colon. The optional colon that terminates the "magic signature" can be omitted if the pattern begins with a character that does not belong to "magic signature" symbol set and is not a colon.

So if we complete `:/foo`, that "works" because "f" is alphanumeric
and so the "/" is the only magic character here.

If, however the filename starts with a magic character, that's used as
a magic signature.

So we do what the docs say and terminate the magic signature after the
"/" (which means "from the repo root").

Fixes #9004
2022-06-07 20:10:13 +02:00
Kid
9238bbde65 Update kitty completion 2022-06-07 16:26:09 +02:00
exploide
44205b188b completions 7z: allow to complete file names 2022-06-07 14:30:23 +02:00
Mike Lei
9d7e0b281b completions: include nologin in useradd/adduser shell options 2022-06-07 14:29:50 +02:00
SeekingBlues
025acfe45a Add -k completion for gzip and gunzip 2022-06-04 13:05:50 -07:00
Fabian Homborg
540aea5999 completions/dnf: Try to stop dnf reading from the terminal
Fixes #8984.
2022-06-01 21:45:50 +02:00
Fabian Homborg
905db80c28 Convert git completions to multi-condition 2022-05-30 20:47:14 +02:00
Fabian Homborg
f10deb124b completions/string: Use multiple conditions 2022-05-30 20:47:14 +02:00
Fabian Homborg
e6136f08fb completions/path: Add --reverse 2022-05-29 20:36:11 +02:00
Fabian Homborg
5d96f5d00b Update completions 2022-05-29 17:48:40 +02:00
Fabian Homborg
80e04a1e86 Rename real to resolve also in completions 2022-05-29 17:48:11 +02:00
Fabian Homborg
5c28473183 Update completions 2022-05-29 17:48:11 +02:00
Fabian Homborg
dca932eda4 Add completions for path 2022-05-29 17:48:11 +02:00
Fabian Homborg
f5b1063a8b completions/man: See if it exists before calling
Fixes #8977
2022-05-27 08:19:40 +02:00
Fabian Homborg
49d75ff689 completions/git: Print all known files for git log 2022-05-26 14:17:15 +02:00
mhmdanas
b3de630d40 Add signoff options to git commit completions
Fixes https://github.com/fish-shell/fish-shell/issues/8965.
2022-05-21 20:27:32 +02:00
Jacob Panek
8c44eb5dd3 fix completion, apk {add,manifest} accept files 2022-05-14 10:41:45 -07:00
NextAlone
ce2064d8b6 fix: completion git mv with ls-files 2022-05-14 17:55:39 +02:00
NextAlone
0f18a4f92b fix: git ls-files --stage 2022-05-14 17:11:07 +02:00
Dmitry Gerasimov
39df8f0b3f Add missing cp completions
All of the missing options were present in the GNU cp for more than 8
years, so it makes sense to add completions for them.
2022-05-13 20:55:36 +02:00
Dmitry Gerasimov
bb108435bb Fix wg-quick completion running from root
`wg show` command shows entire interfaces configuration, not just the
list. This breaks completion when running fish from root, because
command output looks like this:

    interface: wg0
      public key: fred2rX85AxpcTObLuiWTzkRPZaXjnhd1C4XOdZOGWs=
      private key: (hidden)
      listening port: 12345
      fwmark: 0xca6c

    peer: g2YHHDkxmgoT9EV0TxKtq556WLXpaOh4zgC5L7EAGTQ=
      endpoint: 192.168.88.50:54321
      allowed ips: 0.0.0.0/0, ::/0
      latest handshake: 1 minute, 37 seconds ago
      transfer: 1.83 MiB received, 927.19 KiB sent

To show just the list of active interfaces, `wg show interfaces` should
be used instead.
2022-05-13 20:55:24 +02:00
Dmitry Gerasimov
4e19bfb5ed Add --no-patch option to git show completion 2022-05-12 20:31:44 +02:00
NextAlone
bd1e07de23 fix: complete git rebase with commits first and keep-order
Because TAGs are easy to type and complete, but commits with its SHA are
difficult to complete manualy. Keep commits and TAGs order to show more recent
commits first.
2022-05-12 20:30:33 +02:00
merelymyself
ed8148233e completions/git: add options for grep, init, prune, revert, rm, status
Closes #8906
2022-05-01 17:08:00 +02:00
mhmdanas
838fd5f85e Add --unset-upstream to git branch completions 2022-05-01 17:07:36 +02:00
Johannes Altmanninger
ad9b4290e5 completions/git: cache subcommand computation
Whenever completing any git commandline, we invoke __fish_git_using_command
173 times*. Every invocation calls "commandline" and "argparse"
to the same effect. Let's parse the command line once, and reuse the results
later.

I'm observing a speed-up from 200ms to 120ms with

    perf stat -r 10 buildrel/fish -c 'complete -C "git checkout ">/dev/null'

Alternative solutions:
1. teach fish to cache such things automatically.
2. rewrite git completions to compute most completions in a single function,
   which will naturally avoid redundant work. This sounds viable but it's
   a lot of work.

* we have a thousand uses of __fish_git_using_command, so I'm not sure why
it's only 173.

See the discussion in #8266
2022-05-01 16:37:55 +02:00