Commit Graph

2303 Commits

Author SHA1 Message Date
Emily Grace Seville
f15e5ce1da Add yash completion 2022-12-24 11:14:23 +01:00
Fabian Boehm
9da9f698df completions/mpv: Don't use "command"
(the alternative here is to explicitly check `command -q mpv`, but I'm
going for the idea that a thing called "mpv" is going to be an mpv)

Fixes #9426
2022-12-23 11:18:00 +01:00
Emily Grace Seville
6608ddc95b Use just options described in man page 2022-12-22 12:18:53 +01:00
Emily Grace Seville
e9d2bc9db1 Add oksh completion 2022-12-22 12:18:53 +01:00
Clément Martinez
47059d5caa Add completions for tmux options 2022-12-18 16:16:46 +01:00
Johannes Altmanninger
1c084beb43 completions/abbr: offer functions only if --function is given 2022-12-18 09:42:26 +01:00
Johannes Altmanninger
4b81002ab6 completions/abbr: fix when qmark-noglob feature is not turned on 2022-12-18 09:42:26 +01:00
Johannes Altmanninger
0db10056e7 completions/abbr: complete function names if --function is given 2022-12-17 18:09:54 +01:00
Johannes Altmanninger
d61f1d75a8 completions/abbr: minor rewordings 2022-12-17 18:09:54 +01:00
Fabian Boehm
27739b9a47 completions/yarn: Remove nonexistent subcommands
Went by the docs at https://yarnpkg.com/cli/install.

Anything not in the sidebar was removed.

(also rename "upgrade" to "up" because that's a great idea)

See #9375.
2022-12-16 20:47:03 +01:00
Gustavo Costa
b5470fc4c8
Add readelf completions (#9386)
* Add readelf completions

* Improve --debug-dump completions
2022-12-14 20:30:49 +01:00
Johannes Altmanninger
c120305b8d
Merge pull request #9313 from ridiculousfish/mega-abbr
Enhances abbreviations with extra features
- global abbreviations
- trigger on regex match as alternative to literal match
- the ability to expand abbreviations with a user-defined function  
- the ability to set cursor position after expansion
2022-12-12 23:56:11 +01:00
nps1ngh
abc2fc2cb0
Completions for ouch (#9405)
* Completions for `ouch`

* `ouch` completions: also add `l` to subcommands
2022-12-11 15:08:30 +01:00
ridiculousfish
4c3953065a Update abbreviation completions to reflect new features 2022-12-10 16:29:43 -08:00
Johannes Altmanninger
f81e8c7deb completions/git: complete refs for "git grep" 2022-12-08 14:57:48 +01:00
Johannes Altmanninger
e9bf8b9a4e Run fish_indent on share/completions/*.fish 2022-12-08 14:57:48 +01:00
Bagohart
494615891b added completion for git branch --remotes (-r) 2022-12-07 20:19:28 +01:00
EmilySeville7cfg
717800cd6c Add nu completion 2022-12-02 13:12:57 -06:00
calfcalfcalfd
e41ba6a2b6 Fixed typo in xrandr completions 2022-12-02 12:46:42 -06:00
exploide
e4cde861a4 completions hostnamectl: updated to systemd 251 2022-11-29 17:31:02 -06:00
Aaron Gyes
b6ca8dca27 ksh.fish fixup: remove errant line 2022-11-27 20:50:00 -08:00
Aaron Gyes
fd252daafd ksh completions: add descriptions
Also remove options ksh --help says are obsolete.
FWIW ksh93 does a bit more than what is here but this is pretty
good.
2022-11-27 20:46:14 -08:00
Emily Grace Seville
c49f0c8be9
es: add completion (#9388)
* Add `es` completion

* Add `-d` option

* Add option's descriptions
2022-11-27 14:36:17 +01:00
Emily Grace Seville
253b063c88 Add xonsh completion 2022-11-27 14:34:19 +01:00
Emily Grace Seville
e8a7f7eb8e
reg: completions for key entries (#9382)
* Add `__reg_run_reg_safely` for quering keys, and:
- `reg` placeholder
- try make key ccompletion for `__reg_add_complete_args`: doesn't work

* Simplify `__reg_run_reg_safely`

* Fix key completion in `__reg_add_complete_args`

* Add key completion to `delete` subcommand

* Add key completion to `export` subcommand

* Add key completion for `query` subcommand

* Add key completion for `save` subcommand

* Remove `reg` placeholder

* Remove `which` check
2022-11-27 14:26:25 +01:00
EmilySeville7cfg
14f4f3d192 Add rc completion 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
55a06f8087 Add wish completion 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
e99501a08b Add qshell completion 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
11504f79bb Add available options for [-+]o option for ksh 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
106552ac42 Add ksh completion 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
e0fb7f420f Add tcsh completion 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
f5c03227fa Add csh completion 2022-11-26 17:44:25 -08:00
EmilySeville7cfg
3310ee4a0e Add completion for pix, xed, xplayer, xreader, xviewer (#9379)
Closes #9379
2022-11-26 09:45:12 +01:00
Emily Grace Seville
74b8a3befc Add completion for konsole (#9371)
Closes #9371
2022-11-26 09:45:12 +01:00
Emily Grace Seville
b6b4c6806f Add completion for ark (#9362)
Closes #9362
2022-11-26 09:45:12 +01:00
EmilySeville7cfg
a065dd7764 Add completion for dolphin (#9361)
Closes #9361
2022-11-26 09:45:12 +01:00
EmilySeville7cfg
4a85091ed7 Add completion for okular (#9358)
Closes #9358
2022-11-26 09:45:12 +01:00
EmilySeville7cfg
51141b9a2f Add completion for kb (#9357)
Closes #9357
2022-11-26 09:45:12 +01:00
EmilySeville7cfg
a4c9b3a70d Add completion for eg (#9356)
Closes #9356
2022-11-26 09:45:12 +01:00
exploide
3c3e7369ae completions: added ykman, the yubikey management tool
it is able to generate its own completions using click
2022-11-23 12:40:51 -06:00
Bart Libert
00b34e28a2 completions: Add toot 2022-11-22 17:15:40 -06:00
Johannes Altmanninger
b98cee10bb completions/scp: inhibit ls redefinitions
scp completions use "ls" to list files on the remote host.  If a user aliases
them (in noninteractive shells) this will break. In general, this is the
users fault but also kind of ours because we shouldn't really use "ls" here.
Let's work around this problem by skipping functions.

Fixes #9363
2022-11-20 13:46:07 +01:00
Dmitry Gerasimov
f130e36c7e Autocomplete tag names after vim -t
Implement completion for vim tags from any place within the source tree.

To prevent freezes on a huge tags file (e.g., on one from the Linux
kernel source tree), amount of completion lines is limited to 10000.

Note that the TAGS file (EMACS-compatible tags file) is not searched
here as it would not be used by vim anyway.
2022-11-18 12:52:37 -06:00
Terje Larsen
2cd063e28b Add curl request method argument completion 2022-11-18 12:47:28 -06:00
Mahmoud Al-Qudsi
03758ce129 completions/git: Add some options for init.defaultBranch
[ci skip]
2022-11-16 12:39:47 -06:00
Johannes Altmanninger
108108bb5e completions/flatpak: remove broken version checks
flatpak completions gate some features behind checks like

    test $flatpakversion -gt 1.2

which does a floating point comparison, which is different
from version comparison.

Most of these version checks are irrelevant anyway because they check for
a version that's not even in Debian oldstable.  The only one that might be
relevant is a check for version 1.5 but that only gates some extra subcommands;
there's little harm in providing them too.

So let's just remove the version check.

Hopefully fixes #9341 (untested)

Note that flatpak upstream provides a completion file too - but it's shadowed
by ours on my system. This is a tricky issue for another day.
2022-11-12 22:31:59 +01:00
Aaron Gyes
d31847b1d8 Fix apparent dyslexia 2022-11-12 05:47:27 -08:00
Collin Styles
9a870f40c2 Add --[no-]update-refs options to git-rebase completions
These were added in git 2.38.0:
https://github.com/git/git/blob/master/Documentation/RelNotes/2.38.0.txt
2022-11-12 00:04:30 +01:00
Mahmoud Al-Qudsi
51087fd39e Complete env var names and values from history 2022-11-09 15:37:40 -06:00
Mahmoud Al-Qudsi
add1df12b3 Fix env completions
Previously an environment variable to redefine would only be suggested if you
had not yet started typing one out. This makes it so that `env C<TAB>` will also
complete to, for example, [ `CC=`, `CXXFLAGS=`, ... ].

It also is smarter when suggesting variable names to complete: if a variable has
already been completed, it isn't suggested again. Additionally, it only suggests
names for variables that are exported, not all variables (the previous list was
insanely long and including things like all our `fish_...` variables).
2022-11-09 13:42:19 -06:00
Dmitry Gerasimov
3ac6bdd437 Update tree completions
Update completions for the tree command. There are a lot of new options
were added since the 1.6.0 release (which apparently was used to create
current completions).

Options are also reordered to follow the "tree" help.
2022-11-08 20:16:24 -06:00
exploide
ccebe1a169 completions: added systemd-cryptenroll 2022-11-06 11:38:42 -06:00
Branch Vincent
aa30774b0d completions: add op 2022-11-01 19:02:32 +01:00
exploide
535bba77c4 completions: added efivar 2022-11-01 18:52:24 +01:00
Lia Lenckowski
c5a026c955 add completion for loadkeys 2022-11-01 18:51:17 +01:00
Lia Lenckowski
0a6efdc4ad fix lsblk column completion 2022-11-01 18:50:21 +01:00
Mahmoud Al-Qudsi
36ae867e28 completions/git: Allow completing known values for config keys
Currently populated with support for handling just one key
(diff.algorithm) but there are others.
2022-10-31 12:45:56 -05:00
Aaron Gyes
02998aba76 git.fish: update general options
Adds a few options I see in my git manpage that were omitted:
-v, -h, -P, --config-env, --no-optional-locks, --list-cmds

Reword most general option descriptions
2022-10-30 15:26:38 -07:00
Fabian Boehm
9948bc2264 completions/apt: Add quotes
Simple way to make the apt completions spew:

function apt; end

on a system without an apt command installed. (even if it isn't
Darwin, because this uses test combiners!)

This is a thing some people do to avoid learning other package managers.

(of course our completions would probably be *wrong* still, but at least they
won't spew a `test` error)
2022-10-30 11:27:34 +01:00
Aaron Gyes
7c680af4e3 disable apt completions on macOS
macOS has a /usr/bin/apt that is some tool requiring Java,
abort the completions to avoid the confusing package manager
completions.
2022-10-29 11:28:37 -07:00
Aaron Gyes
a6e2e52eef apropos completions for macOS/BSD variants
This should show the correct options for macOS, NetBSD,
FreeBSD, OpenBSD, and DragonFly.
2022-10-28 11:07:35 -07:00
Aaron Gyes
c887e5dbde Fix apropos completions
The 'str' variable was apparently mistakenly removed by 49c5f96470.

Re-add it, and regex-escape it as well.

Allow completing on apropos <TAB> instaed of requiring an initial char.

Use __fish_apropos instead of apropos.

New regex to hopefully work on more platforms.

Explicitly use ^ instead of adding it at __fish_apropos
2022-10-28 10:01:35 -07:00
Aaron Gyes
054d0ac0ea git completions: undo mistaken set -f usage
and fix issue in __fish_git_needs_command
2022-10-28 01:14:45 -07:00
Aaron Gyes
b8dee05ad0 completions: remove functions that are never used
None of these __functions defined in completions are used or
referenced anywhere.

Found with:

function unused -a file search -d 'find unused functions'
  set -f (string replace -fr '^[\s]*function ([\w_]+).*' '$1' < $file)
  for cmd in $cmds
    printf %d\ %s\n (grep -r ".*$cmd.*" $search < $argv | count) $cmd
  end | string match '1 *'
end

for file in share/*/*.fish
  unused $file share && printf "in %s\n" $file
end
2022-10-27 23:25:44 -07:00
Aaron Gyes
f5711ad5ed git.fish: collapse repeat complete cmds, set -f, rm unneeded funcs
Get rid of functions:
__fish_git_diff_opt,
__fish__git_append_letters_nosep,
__fish_git_sort_keys

Use `set -f` inside blocks instead of `set -l foo` before blocks.

Two of these just printed out the argument\tdescription dictionaries
without providing any utility: only used once, just do it inline.

Collapse adjacent lines that look like
complete git -n '(blah)' -l option -d 'option help'
complete git -n '(blah)' -l option -a 'arg1' -d 'description 1'
complete git -n '(blah)' -l option -a 'arg2' -d 'description 2'
complete git -n '(blah)' -l option -a 'arg2' -d 'description 3'
...

into

complete git -n '(blah)' -l option -d 'option help' -a "
arg1\t'description 1'
arg2\t'description 2'
arg3\t'description 3'
..."

This sped up the source time about 10% by running complete
less.
2022-10-27 22:19:32 -07:00
Fabian Boehm
14ecb63e40
completions/usermod: Fix subu/gid option spelling
It's "subuid", not "sub-uid".

Fixes #9303
2022-10-25 11:09:41 +02:00
Clément Martinez
eeaf342426
Add nvme completions 2022-10-22 17:16:14 +01:00
Rocka
f3372635fa completions: fix qdbus property completion 2022-10-21 18:30:54 +02:00
pagedown
ad55a55734 completions/unzip: Silence stderr 2022-10-21 18:29:14 +02:00
exploide
fa932533f2 completions john: redirect stderr to avoid errors 2022-10-19 20:17:58 +02:00
Fabian Boehm
054f9baf88 Add a fish_delta helper function
This helps figuring out which functions, completions and config you've overridden.
2022-10-19 20:06:35 +02:00
Fabian Boehm
c84e2eeac1 completions/git: Fix option
This was typoed in bef706b8f1
2022-10-14 23:14:49 +02:00
Mahmoud Al-Qudsi
acb77ad1a3 completions/git.fish: Sort in order of likelihood
In the presence of modified files, assume `git checkout ...` is being
invoked/completed with the intention of restoring modifications. Even if not the
case, this list is likely going to be shortest if someone is about to change
branches.

Afterwards, list branches (with local branches sorted by recency), then remote
unique remotes, heads, tags, and recent commits. The order of these last four
is up for debate, and honestly if any of them generate a lot of results it makes
finding what you're actually looking for in the autocompletions a lot harder.

It may be better to merge these last contenders and sort them by individual
recency instead, but that does make the pager entries rather messy (and we would
need to add a new function to do that in order to interleave them in the desired
sort order but preserve the overall sort after the completions subshell
terminates).
2022-10-14 15:29:46 -05:00
Mahmoud Al-Qudsi
bef706b8f1 completions/git.fish: always group -k with -a
It's really hard to see where -k is applied to git completions, so always group
it with -a to make it more consistent and easier to spot.

There should be no functional changes in this commit.
2022-10-14 15:20:41 -05:00
Bart Libert
759ca16b37
completions: Add dua (#9277) 2022-10-14 18:52:14 +02:00
Kjetil Thuen
c3052a6218
Add clojure completions (#9272)
* Add clojure completions

* More ideomatic fish code

* Clojure completions in separate file

* Aboid use of psb using bb -e

* Return early when bb can not be found

* Remove superflous escape

* Another superflous escape
2022-10-14 18:50:47 +02:00
Alexander Sieg
8f394f5771
Add completions for direnv (#9268)
* Add completions for direnv

* Update share/completions/direnv.fish
2022-10-14 18:48:38 +02:00
Mahmoud Al-Qudsi
22f6668914 completions/cargo.fish: Drop removed subcommand
`describe-future-incompatibilities` is no longer a supported subcommand. It was
also never something very popular so we don't have to worry about older
versions.

[ci skip]
2022-10-13 12:38:41 -05:00
Gustavo Costa
62794446b7 Add asciinema completions 2022-10-05 18:53:54 +02:00
Sergei Shilovsky
e274ef6c0d
commandline --selection-start and --selection-end implementation
Fixes #9197
2022-10-05 18:51:00 +02:00
Mahmoud Al-Qudsi
82b78cfdbe Add missing -k to git completions
This is made much harder than it has to be by the fact that -k (where specified)
may be in any of a million different places, including as the first parameter,
as -ka, as a random standalone parameter, or tagged on to some other parameter
elsewhere; making it difficult to tell where it's actually missing!

Next job: automate cleaning up the order of arguments in this completions file.
2022-10-04 13:06:15 -05:00
Collin Styles
a5764663e7 Exclude current directory ('.') from rsync completions
Completing to '.' isn't useful and just gets in the way.
2022-10-04 12:53:17 -05:00
NextAlone
ef844a63b9
completion/adb: rework completions (#9233)
* add adb options

only complete device serial when space after '-s' option

* keep current `adb -s` completion

* add adb reboot fastboot

* only show tcp/ip devices for disconnect

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

* fix: files not complete when options given

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

* fix: use old-style options for adb generic options

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

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
2022-10-01 11:21:52 -05:00
NextAlone
794926d28e
completion/completions: use string match to detect usbip remote
* completion/usbip: use string-match to detect remote (#9250)

* simplify output

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

Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
2022-10-01 11:19:29 -05:00
Mahmoud Al-Qudsi
40a0ea9bea Completions: sort local git branches by recency
I have about fifty git branches for fish and I almost always `git checkout`
between the most recent two or three - this makes the completions list more
usable. If you're using `git cherry-pick` or `git merge`, etc. you also most
likely to want to reference a recently changed branch.

The decision was made to only sort local branches and not remote ones in the PR
at #9248.

The performance of changing from one `git for-each-ref` invocation to two
separate ones (so we could sort them separately) was checked and found to be OK.

Food for future thought: consider ergonomics, caveats, and performance of
excluding the current branch's name from the list of completions (or perhaps
only from the first completion). Or maybe there's another way to have
`for-each-ref` give priority to a different branch while still sorting by
recency?
2022-09-30 19:05:27 -05:00
Mahmoud Al-Qudsi
6df57a6712 git completions: Change some default ASC/DESC for sort
Dates and file sizes are kept DESC while names, emails, and hashes are now
defaulted to ASC.
2022-09-30 15:09:14 -05:00
Mahmoud Al-Qudsi
d9bb91f1e1 git completions: fix spelling of committer everywhere
Some of the fixes are only for descriptions, others affect functionality.
2022-09-30 15:08:32 -05:00
Mahmoud Al-Qudsi
ce451f67c5 Suggest arguments for recently added git rebase --onto
It takes a wide variety of values, but I think branches are probably the most
common payloads. We can also include recent commits?
2022-09-29 16:57:23 -05:00
NextAlone
ffdef493c5
completion: add git rebase --onto (#9244)
Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com>
2022-09-29 15:34:47 -05:00
NextAlone
d065ea31a9
completion/usbip: don't use old-style completions (#9243) 2022-09-28 20:37:46 -05:00
Mahmoud Al-Qudsi
072dbfd6ed Remove __fish_seen_argument_from
Despite its somewhat misleading name, `__fish_seen_argument` can already handle
multiple arguments in one go and doesn't need a wrapper function!
2022-09-27 18:49:22 -05:00
Mahmoud Al-Qudsi
77941ea823 Completions: add git xxx --sort completions
The list of subcommands that emit a list of refs when executed bare may or may
not be complete; I just put the ones I know of.
2022-09-27 14:19:37 -05:00
Mahmoud Al-Qudsi
725c720d3d Completions: add git for-each-ref subcommand and its arguments 2022-09-27 14:19:37 -05:00
Fabian Boehm
5d5709b859 completions/ls: Remove dubious old-style option
Confirmed on NetBSD: The `ls -o` option groups. I tested `ls -gon` and
it didn't give an error.

It's quite suspect that this one option couldn't be grouped, so I'm
assuming this was a typo.
2022-09-26 21:31:21 +02:00
Fabian Boehm
47a4eeff99 completions/kcmshell5: Silence stderr
This can print errors about .desktop files not being 100% correct.

Like those shipped by KDE, with krunner.
2022-09-26 20:43:31 +02:00
Fabian Boehm
42602ba4fc
completions/ffmpeg: Add missing parenthesis
Going by the other `string match`, this appears to just be missing a ")".

Fixes #8514
2022-09-26 15:11:58 +02:00
Ryuhei Yoshida
51177ef0ae Fix completions/tox 2022-09-26 09:45:54 +02:00
NextAlone
4b9c7fa534
Add usbip completions
Closes #9237
2022-09-25 15:30:34 -05:00
NextAlone
549958a7ea
add adb logcat completions (#9219)
* add adb logcat completions

and suppress adb devices file completions

* fix lost space
2022-09-19 17:52:09 +02:00
NextAlone
404cee579b add fastboot oem subcommand completions 2022-09-19 17:51:40 +02:00