Commit graph

2405 commits

Author SHA1 Message Date
Fabian Boehm
7f76f75966 completions/git: Add fast path for untracked files
It's super easy to get a lot of these and they'll otherwise slow down
the completions a lot.

This makes `git add <TAB>` ~5-6x faster with about 4000 untracked
files (a copy of the fish build directory). It goes from 1.5 seconds to
250ms.

This is just for the git >= 2.11 path, but the other one would require
more checking and since git 2.11 is almost 7 years old now that's not
worth it.
2023-07-13 16:46:22 +02:00
Fabian Boehm
1f1975689e completions/git: Don't check commandline so much
This just caches some checks, speeding up `git add ` completions by
~33% with 4000 matching files.
2023-07-13 16:31:33 +02:00
pd
ac2810e9ef Fix rclone autocompletion script sourcing issue in fish shell 2023-07-07 21:34:12 +02:00
may
e3e7ab77ad add stash completions to git show and git diff 2023-07-05 10:53:17 +08:00
David Adam
472d7efe34 completions/status: add basename and dirname 2023-07-04 23:32:39 +08:00
Francois Laithier
a7ac92f62f Use __fish_complete_directories to help complete dirs only 2023-07-01 11:01:36 -07:00
Francois Laithier
911a5a97a8 Add completion option for curl
Add missing completion for curl's `--output-dir` option
2023-07-01 11:01:36 -07:00
Fabian Boehm
b043a1c35f completions/help: Add custom-prompt 2023-06-28 16:13:20 +02:00
Fabian Boehm
0cfdc90551 completions/unzip: Dangit FreeBSD
No "--help" and the man page doesn't mention "-h".
2023-06-18 21:27:29 +02:00
AsukaMinato
bab8fb9517
Add i o for unzip (#9850)
* add -I -O for unzip

* for different distroes.

* avoid grep
2023-06-18 21:04:43 +02:00
Fabian Boehm
946ecf235c Restyle fishscript and python 2023-06-01 18:20:19 +02:00
may
d19a08cd8c
update npm completions (#9800)
* update npm install completions

* update npm uninstall

* init npm dep rewrite

+ init npm

* npm uninstall complete global packages

* add npm pack completions

* add npm publish completions

* add npm init completions

* add missing commands, remove outdated, add missing aliases

* add npm audit completions

* implement requested changes

* rename __yarn_ to __npm_

* add missing commands / aliases

* slightly less verbose options, reword dry-run description (meh)

* more commands and options

* add and update completions for several commands

* access, adduser, bugs, ci, config, cache
* dedupe, deprecate, dist-tag, diff, docs, doctor
* edit, exec, explain, explore, find-dupes, fund
* hooks, help-search, install, ls, publish, search
* version, view

* more commands, fixes

* fish_indent

* remove most aliases from command suggestions

* add most other commands

* npm help, --help

* minor fixes

* remove npm builtin completion, new install option, fish_indent

* add completions for npm set, npm get
2023-05-30 11:22:18 +02:00
may
6b1e6dd179
add completions for git update-index (#9759)
* add git update-index completions

* remove todo

* fix leftover from copying lines

* improve and shorten
2023-05-30 11:21:00 +02:00
Kevin F. Konrad
ffb6168221 implement completion for age and age-keygen 2023-05-27 11:15:37 -07:00
Fabian Boehm
aac30367bf completions/systemctl: Add some missing commands
Fixes #9804
2023-05-21 10:02:26 +02:00
Fabian Boehm
d855725965 completions/dnf: Use lowercase queryformat
See de9c5c5b59

Fixes #9783
2023-05-08 18:34:02 +02:00
Rocka
c21e13e62e completions: fix qdbus Q_NOREPLY method completion 2023-05-07 14:34:03 -07:00
Mahmoud Al-Qudsi
220ffaeb65 Add completions for builtin disown
It completes identical to `fg` and `bg` w/ this change. I'm not aware of any
reason why it shouldn't, but feel free to enlighten me if I've missed something.

[ci skip]
2023-05-05 16:08:58 -05:00
Fabian Boehm
0963e6769e completions/wvdial: Use path 2023-04-29 16:15:13 +02:00
Fabian Boehm
2f997ba8a2 Remove a useless sort 2023-04-29 16:15:07 +02:00
Fabian Boehm
32715ee504 completions/sv: Use path 2023-04-29 15:58:52 +02:00
Kid
93dc8485dd Remove kitty completion in favor of official integration 2023-04-25 19:28:55 +08:00
Yuntao Zhao
20b500dce8
Add rpm-ostree completion (#9669)
* Add rpm-ostree completion

Add basic command completion for rpm-ostree. This should improve the
user experience for fish users using rpm-ostree.

* Shorten rpm-ostree descriptions

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2023-04-23 12:55:00 -05:00
Jannik Vieten
480133bcc8
Improve jq completions and add gojq completions
* completions: updated jq completions

* completions: added completions for gojq

* Shorten jq completion descriptions

* Update gojq.fish

Capitalize first letter of descriptions to match other completions.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2023-04-23 12:35:41 -05:00
exploide
30ae715183 completions: added ip neigh completions 2023-04-23 17:48:58 +08:00
may
beca70458b add recent commits to completion for git switch --detach 2023-04-21 07:44:50 +02:00
AsukaMinato
f5e063a462
add-qjsc-fish (#9731)
* add-qjsc-fish

* fix -o qjsc.fish
2023-04-19 19:21:55 +02:00
Fabian Boehm
db5c9badad completions/git: Escape custom command names
This can be triggered by having a custom git command in e.g.
`/mnt/c/Program Files (x86)/foo/`.

Fixes #9738
2023-04-18 20:40:14 +02:00
Jan Tojnar
9e223577aa Fix composer require completion
When no development dependencies are installed, the completion would crash with:

    KeyError: 'require-dev'
2023-04-12 21:05:23 +02:00
Paweł Piątkowski
bda9d57417 Ansible completion: fix typo in --limit-hosts 2023-04-12 16:52:13 +02:00
Eric N. Vander Weele
fdd4bcf718 completions/git: Allow switch to complete remote branches
While it is true that `git switch <remote-branch>` errors to disallow a detached
head without the `-d` option, it is valid to use any starting point (commit or
reference) in conjunction with the `-c` option. Additionally, the starting point
can occur before any option.

This enables the following completions:

* `git switch -c <local-name> <any-branch>`
* `git switch <any-branch> -c <local-name>`
* `git switch -d <any-starting-point>`
* `git switch <any-branch> -d`

The trade-off is this does allow for `git switch <remote-branch>` to be
completed with an error.

Note that this logically reverts 7e3d3cc30f.
2023-04-10 17:04:34 +02:00
AsukaMinato
8a0510a2f2 add qjs completion 2023-04-10 11:02:43 +02:00
AsukaMinato
36e4b0ff30
add completion for ar (#9720)
* add completion for ar

* clean the function

* update CHANGELOG
2023-04-10 11:01:47 +02:00
abp
bbe2a2ba9b completions: Shortened descriptions
- Mainly work is done on gcc
- Some duplicated removed elsewhere
2023-04-09 11:33:23 -07:00
Miha Filej
b5bfff9cac
completions/mix: Add options for phx.new in 1.7.2 (#9706) 2023-04-04 07:41:11 -05:00
Marcin Wojnarowski
0f1ef34736
Fix adb path completion (#9707)
Support paths with spaces.
2023-04-03 22:06:15 -05:00
Robert Szulist
9bd1dc14e5
Add Zabbix completions (#9647)
Add Zabbix completions
2023-03-31 22:13:40 -05:00
Fabian Boehm
bc04abe3ec completions/git: Don't take options for --{force-,}create
We do the same for checkout -b.

Fixes #9692
2023-03-28 17:20:45 +02:00
Fabian Boehm
563b4d2372 completions/git: Complete branches for --set-upstream-to
See #9538
2023-03-27 22:57:34 +02:00
Emily Grace Seville
ba7785856e Add md-to-clip completion
- https://github.com/command-line-interface-pages/v2-tooling/tree/main/md-to-clip
2023-03-27 17:29:53 +02:00
Chris Wendt
3a72d098e2
Use stack's dynamic completions (#9681)
* Use dynamic completions for stack

* Pass the plain command
2023-03-27 17:29:14 +02:00
NextAlone
45b6622986
completion/ssh-copy-id: add completion (#9675)
Add completions for ssh-copy-id.

Refactored __ssh_history_completions into its own file for autoloading across completions.
2023-03-22 12:24:18 -05:00
NextAlone
ff34c1a573
completion/git: complete tags for force option (#9678) 2023-03-22 11:07:18 -05:00
sigmaSd
860de8aa8f minor cleanup 2023-03-22 11:00:59 -05:00
sigmaSd
b95085609e deno task take one argument max 2023-03-22 11:00:59 -05:00
sigmaSd
93bf4e1187 Update deno task completions to handle deno.jsonc and package.json 2023-03-22 11:00:59 -05:00
NextAlone
da3323bbc2 completion/adb: add execout and complete props
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-03-21 22:20:36 -05:00
lengyijun
aa65856ee0 Fixes #8924 via __fish_complete_suffix overhaul
Before:
* hand write arg parse
* only accepts one suffix

After:
* use `arg_parse` to parse args
* accepts multi suffixes

Closes #9611.
2023-03-12 22:07:44 -05:00
Shun Sakai
1a7e3024cc
Update completions for pandoc (#9651)
- Change completions for input formats, output formats and highlight
  styles to dynamically complete
- Add more valid PDF engines
2023-03-10 16:44:03 -06:00
NextAlone
f0c5484eda
completions/adb: unroot and optimize devices show (#9650)
* completions/adb: add unroot command

Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>

* completions/adb: use product and model both to show device

Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>

---------

Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-03-10 16:42:54 -06:00
sigmaSd
307c58dd07
Add completions for deno task subcommand (#9618)
[ci skip]
2023-03-05 13:43:38 -06:00
Next Alone
e12e615a5a completion/fastboot: fix completion to flash and format
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
2023-03-04 12:23:46 -08:00
Shun Sakai
189f4ca3c3 Add completions for scrypt 2023-02-19 10:22:01 -08:00
bagohart
3dd8db281b
Add tab completion for stow (#9571) 2023-02-18 18:37:45 +01:00
Delapouite
a29d760ca0 completions/systemctl: add import-environment command
Man page reference:
https://man.archlinux.org/man/systemctl.1#Environment_Commands
2023-02-18 18:36:30 +01:00
NextAlone
176097cc49 completions/apkanalyzer: add completion for apkanalyzer
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-02-15 19:00:47 +01:00
Fabian Boehm
cbc66fe6ea completions: More shortened descriptions 2023-02-14 21:16:22 +01:00
Fabian Boehm
d9a9fb50d0 completions/cargo: Descriptions 2023-02-14 21:04:05 +01:00
Fabian Boehm
902782b1f4 completions/rsync: Remove one thing that isn't an option 2023-02-14 20:47:52 +01:00
Fabian Boehm
38b21fc1c7 completions/gcc: Shorten descriptions
Many of these are just entirely useless and I'm thinking of removing a
bunch of options.
2023-02-14 20:47:52 +01:00
mhmdanas
a67b089c89 completions/xbps-query: complete package name after -X 2023-02-14 20:32:33 +01:00
Jay
ce268b74dd
completions/trash-cli: add completions for trash-cli (#9560)
Add completions for trash-cli commands:
trash, trash-empty, trash-list, trash-put and trash-restore.

``trash --help`` are used to identify the executable in trash cli completion.
2023-02-13 12:10:55 -06:00
Dmitry Gerasimov
c3a72111e9
completions/meson: rewrite meson completions (#9539)
Rewrite completions for meson to expose meson commands with their
options and subcommands. New completions are based on the meson 1.0.

Subcommands were introduced in meson 0.42.0 (August 2017), so new
completions will only work for versions after 0.42.0. At this moment,
even oldstable Debian (buster) has meson 0.49.2 -- which means it is
unlikely someone will be affected.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2023-02-11 17:58:45 -06:00
Fabian Boehm
24fb7ff67c completion/scons: Shorten descriptions 2023-02-10 21:10:05 +01:00
Fabian Boehm
4adb34d349 completions/dpkg-reconfigure: Don't run awkward things on source time
This wanted to get the default priority, and it ran a thing *at source
time*.

This can lead to a variety of errors and I don't believe it's all that
useful, so we remove it.
2023-02-10 20:58:58 +01:00
Fabian Boehm
7d7b72f995 Use path basename instead of basename
This is faster and guaranteed to be available
2023-02-10 20:51:22 +01:00
Fabian Boehm
7b8684e469 completions/netcat: Use path 2023-02-10 20:50:14 +01:00
Fabian Boehm
cac483c67a completions: Quote some tests 2023-02-10 20:47:49 +01:00
Fabian Boehm
6fe4b0c24d completions/kb: Fix 2023-02-10 20:46:34 +01:00
NextAlone
c587b2ffcc completions/fastboot: fix flash completion
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-02-09 20:44:12 -08:00
bagohart
ef07e21d40
Add separate completions for neovim (#9543)
Separate the neovim completions from the vim ones, as their supported
options have diverged considerably.

Some documented options are not yet implemented, these are added but
commented out.

Closes #9535.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2023-02-08 12:47:08 -06:00
Fabian Boehm
f6b390dc61 completions/git: Remove a for-loop
This is an easy win for `git add ` completion time if we have multiple descriptions.

What happened was we did things once per description string, but the
things included a bunch of computation (including multiple `string`
calls and even a `realpath`!). Because these don't change, we can
simply do them once.

And it turns out we can just use a cartesian product:

for d in $desc
    printf '%s\t%s\n' $file $d
end

becomes

printf '%s\n' $file\t$desc
2023-02-06 21:49:07 +01:00
Mahmoud Al-Qudsi
96deaae7d8 completions/apt: Read from the dpkg cache directly
I have no idea why `apt-cache --no-generate show` is so slow since it basically
dumps the contents of the cache file located at `/var/lib/dpkg/status`. We are
technically bypassing any waits on the cache lock file so this may produce
incorrect results if the cache is being regenerated in the moment, but that's a
small price to pay and the results are likely confined to simply not generating
comprehensive results.

With this change, we no longer need to truncate results to the first n matches
and we no longer only print packages beginning with the commandline argument
enabling fish's partial completions logic to offer less-perfect suggestions when
no better options are available.

Even though we are generating more usable completions, we still trounce the old
performance by leaps and bounds:

```
Benchmark #1: fish -c "complete -C\"apt install ac\""
  Time (mean ± σ):      2.165 s ±  0.033 s    [User: 267.0 ms, System: 1932.2 ms]
  Range (min … max):    2.136 s …  2.256 s    10 runs

Benchmark #2: build/fish -c "complete -C\"apt install ac\""
  Time (mean ± σ):     111.1 ms ±   1.8 ms    [User: 38.9 ms, System: 72.9 ms]
  Range (min … max):   108.2 ms … 114.9 ms    26 runs

Summary
  'build/fish -c "complete -C\"apt install ac\""' ran
   19.49 ± 0.44 times faster than 'fish -c "complete -C\"apt install ac\""'
```
2023-02-05 16:30:34 -06:00
Mahmoud Al-Qudsi
6f3711902b completions/apt: Use is_first_token instead of seen_subcommand_from
I think this should be preferred for all subcommand completions because it
handles typos or subcommands we don't recognize better (`apt foo <TAB>` no
longer suggests subcommands since the subcommand position has been taken).
2023-02-05 16:15:15 -06:00
NextAlone
3604e8854b completion/adb: remove wait-for-device from subcommand detect
wait-for-device should not be used in subcommand detect, cause it is used as seperate command, following with others.
2023-02-05 12:13:45 +01:00
Branch Vincent
d69a290c2f completions: add pre-commit 2023-02-05 12:12:47 +01:00
Wout De Puysseleir
43a7c20ddb completions/mix: Add mix phx
- Added phx completions. These are very common completions for the Elixir Phoenix Framework.
  Documentation can be found here: https://hexdocs.pm/phoenix/1.7.0-rc.2/Mix.Tasks.Local.Phx.html#content
- Added argument completions
- Made all descriptions start with an uppercase for better consistency
- Update CHANGELOG.rst
2023-02-05 12:10:31 +01:00
Johannes Altmanninger
243ade838b completions/git: also complete filepaths as second argument to git grep
Fixes a regression in f81e8c7de (completions/git: complete refs for "git
grep", 2022-12-08).

Fixes #9513
2023-01-28 21:25:42 +01:00
Johannes Altmanninger
befa240756 completions/git: use builtin path for finding subcommands
This is more elegant and efficient. No functional change.

As suggested by 2da1a4ae7 (completions/git: Fix git-foo commands, 2023-01-09).
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
f033b4df7d completions/git: fix typo 2023-01-24 20:37:38 +01:00
Johannes Altmanninger
7c1c3f9f77 completions/git: do not use user input as format string
Suggested by f5711ad5e (git.fish: collapse repeat complete cmds, set -f,
rm unneeded funcs, 2022-10-27).
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
72e9d02650 Revert "git.fish: collapse repeat complete cmds, set -f, rm unneeded funcs"
That commit did way too many things, making it hard to see the 5 regressions
it introduced. Let's revert it and its stragglers. In future, we could redo
some of the changes.

Reverts changes to share/completions/git.fish from

- 3548aae55 (completions/git: Don't leak submodule subcommands, 2023-01-23)
- 905f788b3 (completions/git: Remove awkward newline symbol, 2023-01-10)
- 2da1a4ae7 (completions/git: Fix git-foo commands, 2023-01-09)
- e9bf8b9a4 (Run fish_indent on share/completions/*.fish, 2022-12-08)
- d31847b1d (Fix apparent dyslexia, 2022-11-12)
- 054d0ac0e (git completions: undo mistaken `set -f` usage, 2022-10-28)
- f5711ad5e (git.fish: collapse repeat complete cmds, set -f, rm unneeded funcs, 2022-10-27)
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
04cae2c559 completions/kak: show -debug arguments
Technically this is a |-separated list, we might need to teach __fish_append
to tokenize.
2023-01-24 20:37:38 +01:00
Fabian Boehm
21f1eebd01 completions/git: Some rewordings
These are the longest subcommand descriptions, so it gives us more space
2023-01-23 21:18:03 +01:00
Fabian Boehm
3548aae552 completions/git: Don't leak submodule subcommands
Introduced in f5711ad5ed through an unclean edit.
2023-01-23 21:17:53 +01:00
Mahmoud Al-Qudsi
9b4c4ee7b6 Don't use sort for fail2ban-client completions
As pointed out by faho, the completions will be deduplicated by the completion
mechanics. We don't use this list directly except to pass it up the chain to the
shell, so there's no benefit to shelling out to eagerly deduplicate the list.

Plus, as of 3.6.0, even manual `complete -C"..."` invocations now deduplicate
results the same as if completions were triggered.
2023-01-19 17:51:22 -06:00
Mahmoud Al-Qudsi
031a6a09a4 Add completions for fail2ban-client
`fail2ban-client` uses nested subcommand syntax and intermixes fixed/enumerable
values with dynamically detected ones. If you know exactly what your overall
command structure looks like, these completions will work great. Unfortunately
their discoverability is a bit lacking, but that's not really fish's fault.

e.g.

* `f2b-c get/set` take certain known values but also accepts a dynamic jail name
* `f2b-c get/set <jail>` take certain fixed options but...
* `f2b-c get/set <jail> action` require enumerating an entirely different set
  of values to generate the list of completions, bringing us to...
* `f2b-c get <jail> action <action>` has a fixed number of options but
* `f2b-c set <jail> action <action> <property>` can be any valid command and its
  arguments

The intermixing of fixed, enumerable, and free-form inputs in a single command
line is enough to make one's head spin!
2023-01-19 12:53:40 -06:00
Kevin F. Konrad
9ee82b143a fix missing required parameter in terraform completions 2023-01-19 17:14:04 +01:00
NaLan ZeYu
093c580b5c Add completion for proxychains 2023-01-18 18:27:07 +01:00
Austin Ziegler
bb6160bae4 Fix open completion for macOS
macOS 11+ (possibly 12+) has an additional place where certain
applications will be installed, `/System/Applications`. This is a sealed
system volume and includes the following applications:

- `App Store.app`
- `Automator.app`
- `Books.app`
- `Calculator.app`
- `Calendar.app`
- `Chess.app`
- `Clock.app`
- `Contacts.app`
- `Dictionary.app`
- `FaceTime.app`
- `FindMy.app`
- `Font Book.app`
- `Freeform.app`
- `Home.app`
- `Image Capture.app`
- `Launchpad.app`
- `Mail.app`
- `Maps.app`
- `Messages.app`
- `Mission Control.app`
- `Music.app`
- `News.app`
- `Notes.app`
- `Photo Booth.app`
- `Photos.app`
- `Podcasts.app`
- `Preview.app`
- `QuickTime Player.app`
- `Reminders.app`
- `Shortcuts.app`
- `Siri.app`
- `Stickies.app`
- `Stocks.app`
- `System Settings.app`
- `TextEdit.app`
- `Time Machine.app`
- `TV.app`
- `Utilities`
- `VoiceMemos.app`
- `Weather.app`

The change here adds `/System/Applications` to the search locations for
`-a` and `-b` options on the macOS completions for `open`. There are
possibly other locations that may be considered (I’m not using `mdls` or
`mdfind` in my functions for "reasons"), but this is partially based on
https://github.com/halostatue/fish-macos/blob/main/functions/__macos_app_find.fish
2023-01-16 18:07:49 +01:00
Mahmoud Al-Qudsi
256713b670 Add missing completion for status current-commandline
`status current-commandline` shipped in fish 3.6.0 but we missed adding this
completion.
2023-01-15 18:04:52 -06:00
Fabian Boehm
905f788b3e completions/git: Remove awkward newline symbol
Konsole draws ⏎  with a width of 2, but widechar_width says it's 1.
That leads to awkward display.

It's also a surprising and distracting symbol in this use.

So just use spaces.
2023-01-10 19:27:16 +01:00
Fabian Boehm
2da1a4ae77 completions/git: Fix git-foo commands
Broken in f5711ad5ed, this neglected to
remove the `git-` part from the command

Fixes #9457.
2023-01-09 18:40:24 +01:00
Fabian Boehm
9e81d7e166 completions/conda: Fix subcommand parsing
This used the naive `__fish_seen_subcommand_from`, which isn't
powerful enough once you allow for `conda create` and `conda env
create`.

Hattip to jvanheugten for the env completions.

Fixes #9452
2023-01-07 11:23:04 +01:00
Johannes Altmanninger
92b1394178 completions/iw: add 160MHz WLAN channel 2023-01-02 18:13:47 +01:00
Dmitry Gerasimov
eb4dc101df completions/git: add "git bundle" support 2023-01-02 18:07:03 +01:00
exploide
08728be319 completions iw: added completions for iw dev set type and set channel 2023-01-02 17:53:56 +01:00
Aaron Gyes
a40b019752 __fish_use_subcommand does not take arguments.
These four completions all have a strange pattern (that doesn't
work.)

    set -l subcommands cmd1 cmd2 cmd3 ...

    complete -n "__fish_use_subcommand $subcommands" -c foo -a cmd1
    complete -n "__fish_use_subcommand $subcommands" -c foo -a cmd2
    complete -n "__fish_use_subcommand $subcommands" -c foo -a cmd3

Remove the redundant lists of subcommands and the unused argument
passed to __fish_use_subcommand for bosh, cf, mariner, and port.
2023-01-01 04:57:53 -08:00
Aaron Gyes
fc7989cecd otool: Add completion 2022-12-31 14:49:17 -08:00
Fabian Boehm
4e7ecdfb40 completions/systemd-cryptenroll: Remove executable bit
Should be harmless
2022-12-30 13:42:54 +01:00