Commit Graph

1119 Commits

Author SHA1 Message Date
Aaron Gyes
3e8c05e32b cat, mv, rm completions: shorten descriptions 2019-03-09 15:02:25 -08:00
Aaron Gyes
c1859b5678 date completions: show correct options for different BSDs, macOS
Also prevents file completions where they are not approprite, and
additionally shortened the descriptions to fit in two pager columns
in an 80-wide terminal for some platforms.
2019-03-09 14:56:25 -08:00
Fabian Homborg
bf926fd6c4 completions/yarn: Don't offer files for yarn run
Pretty sure that, like npm, that's not valid.

[ci skip]
2019-03-09 18:04:21 +01:00
Fabian Homborg
b0e9405b11 Read json via python
Apparently that's actually faster than jq, and it's more likely to be
installed.

Also it should convince the arch packager to remove the jq dependency.

The indentation is weird, though.

[ci skip]
2019-03-09 18:04:21 +01:00
Aaron Gyes
3ac1c29f79 cp completions: shorten descriptions
Enough to fit two pager columns into a 80-wide terminal.
2019-03-09 07:55:46 -08:00
Aaron Gyes
7ececa4c69 dmesg completions for all the platforms
+ tweaks for Linux: shorter descriptions, suppress file completions
+ Add correct completions for macOS, NetBSD, FreeBSD, OpenBSD, DragonFly
+ Solaris dmesg has no options, so complete nothing there
2019-03-09 07:29:23 -08:00
Fabian Homborg
62526a3ac8 completions/git: Fix relative paths for older git
If the first file presented was in the current directory, this would
error out.

Fixes #5728.

[ci skip]
2019-03-08 16:03:57 +01:00
Fabian Homborg
eac9ec9093 Add vagrant completions
These aren't perfect, but the tool is pretty much hostile to proper
completions - it includes a "--machine-readable" option, but `vagrant
global-status --machine-readable` prints great output like

```
1551816037,,ui,info,id
1551816037,,ui,info,name
1551816037,,ui,info,provider
1551816037,,ui,info,state
1551816037,,ui,info,directory
1551816037,,ui,info,
1551816037,,ui,info,-------------------------------------------------------------------------
1551816037,,ui,info,d3ea265
1551816037,,ui,info,default
1551816037,,ui,info,virtualbox
1551816037,,ui,info,poweroff
1551816037,,ui,info,/home/alfa/dev/oi-userland
1551816037,,ui,info,
1551816037,,ui,info,fdf42c4
1551816037,,ui,info,default
1551816037,,ui,info,virtualbox
1551816037,,ui,info,poweroff
1551816037,,ui,info,/home/alfa/dev/vagrant/NetBSD
1551816037,,ui,info,
1551816037,,ui,info,f8f6eff
1551816037,,ui,info,default
1551816037,,ui,info,virtualbox
1551816037,,ui,info,poweroff
1551816037,,ui,info,/home/alfa/dev/vagrant/fedora
1551816037,,ui,info,
1551816037,,ui,info, \nThe above shows information about all known Vagrant environments\non this machine. This data is cached and may not be completely\nup-to-date (use "vagrant global-status --prune" to prune invalid\nentries). To interact with any of the machines%!(VAGRANT_COMMA) you can go to that\ndirectory and run Vagrant%!(VAGRANT_COMMA) or you can use the ID directly with\nVagrant commands from any directory. For example:\n"vagrant destroy 1a2b3c4d"
```

and still takes 500ms to do so. The actual information is in a json
file, which we can't expect to read, and it doesn't have linebreaks or
such which we could use to hack-parse it.

So this is the best we can do for the most important bits (the
machineids), so let's just add this as-is.

[ci skip]
2019-03-05 21:02:32 +01:00
radek-sprta
261d48367d Add completions for Mariner (#5718)
* Add completions for Mariner

* Remove unnecessary characters
2019-03-03 20:25:31 +01:00
Fabian Homborg
8939a7ba7a completions/ipset: Don't error on loading
`ipset list --name` is a privileged operation, and it prints an
"Operation not permitted" error when done as a normal user.

What's worse, this did it on loading (the command substitution wasn't
quoted), so we'd print the error as soon as you did `ipset `.

Only do the operation when necessary, and don't print the error.

This'll effectively only make it work for root shells (not e.g. `sudo
ipset`), but I don't want to sprinkle `sudo` in the completion.

(Also why does listing stuff require root? That's not how it works
e.g. for ips. But I don't actually know what ipset is for, so maybe
there is a good reason.)

[ci skip]
2019-03-03 12:43:05 +01:00
Kevin Konrad
0f6b3fd9e4 add completions for cf and bosh 2019-02-25 09:00:42 -08:00
The0x539
e330dafd24 Improve completions for mkvextract
A key frustration with the prior version of mkvextract completions was
that even in a position where a filename would be expected, no
completions for a filename were offered. This update introduces more
rigorous argument handling, most importantly restricting
track/attachment completion to when both a mode and a file are
specified.
2019-02-24 21:17:10 -08:00
Collin Styles
195020ff89 screen: Add completions for -R and -RR options 2019-02-24 21:08:56 -08:00
Collin Styles
06f832aae1 Allow filename completion for screen
Screen commands can be passed an executable to run like:

$ screen -dR my_session /usr/bin/fish

This commit enables completion for that filename
2019-02-24 21:08:56 -08:00
Collin Styles
e475b1a375 Fix screen session name completion for non-Ubuntu distros
For some reason Ubuntu's version of screen includes timestamps in the
output of `screen -list`. The timestamps aren't present on other
distributions (tested on Fedora and Arch Linux), nor when building from
source. This commit fixes the regex so that with or without the
timestamp, fish will correctly show suggestions for screen sessions.
2019-02-24 21:08:56 -08:00
Fabian Homborg
f451499aa6 completions/valgrind: Fix option typo
Fixes #5688.

[ci skip]
2019-02-22 20:03:53 +01:00
Fabian Homborg
c6ec423513 completions/systemctl: Harden version comparison
Arch changed the version string to include the package rel, so it
looks like

    systemd 241 (241.7-2-arch)

which would break our simple `string replace` and `test`.

Fixes #5689.

[ci skip]
2019-02-22 20:00:08 +01:00
Fabian Homborg
50f6fa048e completions/sudo: Quote ?
This was treated as a glob where it was still enabled, most likely removing the "-E" option from argparse,
which caused `sudo -E` to not be parsed correctly, breaking completion.

(There was no error because the glob was used with `set`)

Fixes #5675.

[ci skip]
2019-02-20 22:30:29 +01:00
Fabian Homborg
59955391ad completions/yarn: Allow running scripts as subcommand
Fixes #5674.

[ci skip]
2019-02-19 14:24:02 +01:00
Collin Styles
8a0be93e50 Add completions for "git remote get-url" 2019-02-17 16:30:00 +01:00
Fabian Homborg
d48eb56aea Improve curl completions
Just a bunch of rewriting descriptions and some arguments.

Most arguments here are uncompleteable, and most of these options will
never be used.

[ci skip]
2019-02-16 17:01:02 +01:00
Fabian Homborg
dbeaa0c8de Add curl completion
Mostly copying the autogenerated stuff with some light description
cleanup.

Fixes #5664.

[ci skip]
2019-02-16 16:40:13 +01:00
Fabian Homborg
016d83c3fc completions/git: Handle MM files
These are files with staged modifications, and additional unstaged
ones.

In practice what happened was that you ran

   git add somefile

then editted it some more and tried to

   git add <TAB>

which didn't offer it anymore.

Now, we offer it if either modified or modified-staged is set.

Currently modified-staged isn't ever set alone, but through
all-staged, so we still need to keep offering the file then.

(This shows that the current switch/case might have some holes)

Fixes #5648.

[ci skip]
2019-02-12 16:59:44 +01:00
Aaron Gyes
0377198fc8 Drastically improve fish completions
* complete .fish files
* --debug -> --debug-level
* add --init-command/-C
* add --debug-stack-frames/-D
* add --private/-P
* add --features/-f: lists supported features, supports foo,<TAB>
* -c now completes commands
* -d requires argument, describes 0..5
* --profile: require argument, allow file completion
2019-02-09 22:48:15 -08:00
Aaron Gyes
1049bed5f8 string completions: add -e, -f, --no-empty, shorten -d's
I hope this is now complete.

Also, shorten enough descriptions to make `string match --<TAB>`
show a two column pager with 80 cols.

We really should have shown more retraint in the design of `string`,
not all of the flags required both a long and short option created.
2019-02-07 04:13:38 -08:00
Birger J. Nordølum
df375ea12d brew.fish: Add update-reset subcommand completion (#5608)
* brew.fish: Add `update-reset` subcommand

This command resets all tap's remotes to the latest available upstream.  Ideal for debugging before reporting bugs or just housekeeping.
 
Add missing newlines.

* Add `brew.fish` changes to CHANGELOG.md
2019-02-01 18:02:05 +01:00
raichoo
aebe040fdc document private mode in fish completion 2019-01-31 20:30:41 +01:00
Fabian Homborg
7eee158292 Don't test with one argument
[ci skip]
2019-01-27 15:38:03 +01:00
Fabian Homborg
1cad15b01f Stringify a few more completions
[ci skip]
2019-01-26 19:29:25 +01:00
Fabian Homborg
0640e7bae9 Move prt-get functions into the completion script
These were not used elsewhere.

Part of #5279.

[ci skip]
2019-01-26 19:16:25 +01:00
Fabian Homborg
882da75d29 Remove __fish_commandline_test function
This was only ever used in the commandline completions, and is
equivalent to (a weird example of) __fish_contains_opt.

Part of #5279.

[ci skip]
2019-01-26 19:16:12 +01:00
Fabian Homborg
1e3a46f423 Remove __fish_bind_test* functions
These were only used in the bind completions, so there's no need to
keep these two separate.

Part of #5279.

[ci skip]
2019-01-26 19:16:06 +01:00
wyahiro
e9f0a8cf2c Redo ant completions
Closes #5475
2019-01-23 18:00:21 -06:00
Fabian Homborg
432ed621fd completions/git: Don't sort tags or commits
Sorting these alphabetically just makes no sense, but takes time.

[ci skip]
2019-01-23 15:53:47 +01:00
Fabian Homborg
4af2a681b8 completions/git: Stop offering :/ files so much
Don't do it when the relative path is simple (purely descending),
unless the token starts with ":/".

Also stop offering directories - if they need to be disambiguated, the
normal completion logic will take care of that.

Fixes #5574.

[ci skip]
2019-01-23 14:03:38 +01:00
Aaron Gyes
23e94d8349 improve GNU patch completions
shorter descriptions that can fit in a terminal window, and option arguments added.

hide one option that is only functional on Cygwin unless we are on Cygwin
2019-01-21 22:37:45 -08:00
Aaron Gyes
3115446a07 string completions: add missing upper, lower, split0, join0, unescape
and --style=regex
2019-01-21 17:08:49 -08:00
Sam Yu
02c32c638f Fix completion of directories for configure 2019-01-17 10:13:27 +01:00
Aaron Gyes
fb74ccb1f2 set's color completions: remove Color description.
On `set fish_color_cwd <TAB>`, a bunch of named colors are
shown in the pager. Each and every one has a description of "Color".

These are all very obviously colors, and none are not colors,
the description does not tell us anything specific about the item.

Descriptions in situations like this are actually a hinderance
because of the way they cause less to fit into the pager. Remove it
2019-01-16 10:34:16 -08:00
Fabian Homborg
6d11e46428 completions/git: Also don't use files for porcelain=2
This was an oversight from the previous commit. Not that it matters
much, because we already removed $files.

Still, this would fail if someone defined a global $files, so let's fix it.

[ci skip]
2019-01-13 21:33:00 +01:00
Fabian Homborg
787f453ec2 completions/git: Skip "!" shell-aliases for wrapping
We can't complete these, and now the user can do

```
set -g __fish_git_alias_$alias $command
```

e.g.

```
set -g __fish_git_alias_co checkout
```

if the arguments in the alias end up going to `git alias`.

Fixes #5412.

[ci skip]
2019-01-13 17:20:10 +01:00
Fabian Homborg
73bae383e0 completions/git: Stop limiting to the token
This enables fuzzy-matching outside of the current directory again.

As it turns out, the performance impact here isn't as large as I
thought - it's massively dependent on caching.

Fixes #5476.
2019-01-13 17:05:05 +01:00
Mahmoud Al-Qudsi
6ea7aa8a00 Share code between yarn and npm completions
I had previously introduced a lot of updates and fixes to npm registry
based completions for `yarn` but hadn't ported them to `npm` as well
(although they can be dropped in as-is). This patch shares the code
between the two, which resides in an explicitly sourced multi-function
fish script.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
56cedac3b5 Show info about all-the-package-names helper for yarn/npm completions
The informational message is only shown the first time an attempt at
completing `yarn add` is made per session. This should vastly improve
the discoverability of this feature as regular yarn/npm users would
never have `all-the-package-names` installed normally.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
848ca1c1cc Improve UX by not providing yarn completions if no input
Otherwise, the interface would hang while fish processed the output of
`all-the-package-names` and then would ultimately not show any results
anyhow.
2019-01-10 23:12:49 -06:00
Mahmoud Al-Qudsi
34e104ca35 Allow more flexibility with file completions for yarn
Closes #5502
2019-01-10 23:12:49 -06:00
Varun Arora
89d77df658 add missing tmux new-session flags to tmux completion script 2019-01-10 13:22:02 +01:00
Versus
9743cd77d3 yaourt: recognize *.pkg.tar as valid package extension 2019-01-10 13:13:59 +01:00
David Adam
b4365e972a status completions: tidy, add current-command, fish-path and aliases 2019-01-09 22:32:42 +08:00
Takuya Noguchi
7aca69780c Replace deprecated options with newly introduced options for gem.
Signed-off-by: Takuya Noguchi <takninnovationresearch@gmail.com>
2019-01-01 14:28:13 +01:00