Commit Graph

1134 Commits

Author SHA1 Message Date
Birger J. Nordølum
c300e09e8c brew.fish: Fix brew casks search 2018-08-03 22:46:54 +08:00
Mahmoud Al-Qudsi
09541e9524 Add completions for hjson 2018-07-30 14:38:00 -05:00
Mahmoud Al-Qudsi
392cdd4338 Show a meaningful description of packages in __fish_print_packages
Use `apt-cache show` instead of `apt-cache packagenames` to efficiently
print package names and a brief description instead of the placeholder
(localized) "Package" text that was previously printed. This applies to
both available and installed packages (for inistall and remove operations,
respectively).

TODO: update `__fish_print_packages` for non-debian platforms to do the
same.
2018-07-28 17:44:17 -05:00
Clément Martinez
32ca6118a6 Add virsh completions 2018-07-28 14:44:11 -07:00
raichoo
d4f5689eaa modernize darcs completion
`darcs` has changed a lot in recent years. The completion is no longer
up to date.
2018-07-28 13:10:13 -07:00
raichoo
eb3541be86 add more options to set completion 2018-07-24 20:29:36 +08:00
Twinkle
8440d9ba86 Improve completions for serve 2018-07-24 00:22:13 -07:00
raichoo
b932522138 add more options to psub completion 2018-07-22 15:23:16 -07:00
James Lee
e26bdff487 Improve eopkg completions by using the --installed flag (#5089)
Utilized the `--install` flag added in commit #8c09d6e.

Limit `eopkg remove/autoremove/check ...` completions to installed packages.
Limit `eopkg install/upgrade/info ...` completions to available packages.
2018-07-09 23:21:44 -07:00
David Adam
7de9563aad docker completions: add dummy file noting they are upstream
Suggested in #5090.
2018-07-08 21:38:08 +08:00
Simon Legner
dfbffd13df [completions/git] Fix typo 2018-07-05 22:28:52 +02:00
Fabian Homborg
7ead8f459e [completions/git] Offer containing directories
Fixes #5083.
2018-07-04 15:11:32 +02:00
Sam Yu
495c09fe6b Add subcommand options completion for zypper 2018-07-03 13:45:39 -07:00
Mahmoud Al-Qudsi
8c09d6e063 Limit apt remove ... completions to installed packages only
Added a new flag `--installed` via `argparse` to `__fish_print_packages`
which indicates that only installed packages should be listed.

TODO: Other non-debian/apt platforms should take advantage of this flag/
behavior as well.
2018-07-02 11:43:18 -05:00
Fabian Homborg
817adc123d [completions/git] Don't use --ignored=something
It was only introduced in 2.16, which was released in January 2018.

Instead, we just use a bare "--ignored", which is equivalent to "--ignored=traditional".

The difference to "--ignored=matching" mode shouldn't matter to us here.

Fixes #5074.
2018-06-27 22:02:49 +02:00
Mahmoud Al-Qudsi
144af5116a Allow functions -e completions to complete hidden __fish functions
...but only if the user has started their function name argument with an
underscore.
2018-06-27 14:42:42 -05:00
Mahmoud Al-Qudsi
092307d4c0 Include whatis description for kernel modules in kldload completions
Using `__fish_whatis` based on a heuristic to make sure completions are
timely available.
2018-06-27 14:38:51 -05:00
Mahmoud Al-Qudsi
121c70cf39 Add completions for FreeBSD's kldunload
Lists currently loaded kernel modules as valid completions, and obtains
a description via the newly minted `__fish_whatis` if available.
2018-06-27 14:14:40 -05:00
Sam Yu
9470f8a05b Fix cut completion (#5069) 2018-06-23 15:30:31 -07:00
zhustec
f025607c11 Competion: add missing list-timers for systemctl.fish 2018-06-21 20:10:14 +02:00
Mahmoud Al-Qudsi
fa00183e5f Fix and optimize kldload completions
I'm not sure what was wrong with the old syntax, but I needed to switch
the outer quotes to ' and the inner quotes to " in order for the
completions to work when they weren't explicitly sourced.

Additionally, realized that the overload for __fish_complete_suffix can
be used to get the filtered list of kernel modules from /boot/kernel in
the initial run.
2018-06-19 00:10:40 -05:00
Mahmoud Al-Qudsi
4d909b1c19 Add partial completions for curl, supporting @file syntax
Allows the most painful of curl's arguments to be completed by fish by
restoring file-based completions for paths prefixed with `@` (which are
typically used after parameters like --data).
2018-06-18 23:56:22 -05:00
Mahmoud Al-Qudsi
5061f1666b Add completions for FreeBSD's kldload 2018-06-18 21:01:05 -05:00
Mahmoud Al-Qudsi
072974ec5c Fix service completions on non-FreeBSD platforms
I never realized script-local variables set after the function
definition do not keep their value when the function is executed later
in the file.
2018-06-17 22:03:04 -05:00
Mahmoud Al-Qudsi
31745d29ab Refactor service completions to drop eval usage under FreeBSD 2018-06-17 21:49:39 -05:00
Fabian Homborg
fa665bd3c8 [completions/git] Remove unnecessary helper function 2018-06-15 15:40:04 +02:00
Fabian Homborg
7b86062720 [completions/git] Allow relative paths for files
This is _ugly_ because it is implemented for both status --porcelain
formats, but it is both fast and accurate.
2018-06-15 15:40:04 +02:00
Sam Yu
76749468aa Fix sudo completion
* fix command under sudo get sudo's option completions
* rewrite completion of command under sudo with argparse
2018-06-14 23:05:06 +02:00
Gustaf Johansson
1270bb265f completions: [go] Lookup pkgs from GOPATH
As defined in the `go help packages`:
  Many commands apply to a set of packages:
    go action [packages]
  Usually, [packages] is a list of import paths.

This patch introduces automatic lookup of said packages from GOPATH
using `go list`, and provides them as options go subcmds.
2018-06-13 15:33:29 +02:00
Mahmoud Al-Qudsi
35a7e1ef0e Add intelligent service-specific completions under FreeBSD 2018-06-12 19:24:18 -05:00
Mahmoud Al-Qudsi
eca4273f77 fixup! Add OS check to pkg completions 2018-06-07 13:42:53 -05:00
Mahmoud Al-Qudsi
e8b6705067 Add OS check to pkg completions 2018-06-07 12:22:47 -05:00
Twinkle
3b1806a904 Add completions for serve
See: https://github.com/zeit/serve
2018-06-05 16:36:22 +02:00
Mahmoud Al-Qudsi
086d088e1b Fix scp completions to support bidirectional transfer
Also hardcode standard /bin/ls to avoid issues with `ls` aliases on the
target, and inherit the (improved) list of remotes from `ssh`.
2018-06-04 07:32:21 -05:00
Mahmoud Al-Qudsi
c8c3265cb8 Fix completions for service
I'm not sure what was up with the old completions,
`$__fish_service_commands` is not set anywhere and completions for the
command (not the service) were not being generated on my machine.
2018-06-04 07:32:21 -05:00
Mahmoud Al-Qudsi
fd14e459cf Add completions for xsv 2018-06-04 07:32:21 -05:00
Mahmoud Al-Qudsi
f6a1bc1489 Fix unzip completions for non Info-ZIP versions
macOS and (AFAICT) most Linux distributions ship with the Info-ZIP
version of unzip, which has the `unzip -h` flag; but other
implementations of unzip do not necessarily have it (i.e. FreeBSD).

`unzip` under FreeBSD does not support `unzip -h`. Under both Linux and
FreeBSD, `unzip -v` presents the list of options, though. Using this
instead of `unzip -h` to detect the Debian-patched version of the
Info-ZIP unzip program.
2018-06-03 14:57:11 -05:00
Fabian Homborg
44d68f99ea [completions/gcc] Improve wording
These completions are apparently based on an auto-generated version,
so there's a whole bunch of rewording to be done here.

Also for some reason some of the options are mentioned more than once?
2018-06-01 20:16:23 +02:00
Fabian Homborg
fa8248f170 [completions/git] Don't run __fish_git_refs twice for "log"
That's already included in `__fish_git_ranges`, so we don't need to do
it again.

Mentioned in #4117.
2018-05-30 18:10:52 +02:00
Gustaf Johansson
23eb63eb2f completions: [git] Added git help completions
This patch adds completions for the help subcommand of git.
2018-05-28 12:15:19 +02:00
Luca Weiss
c1af560753 pacman: Recognize *.pkg.tar as valid package extension (#5005)
* pacman: Recognize *.pkg.tar as valid package extension
2018-05-26 15:41:46 -07:00
Mahmoud Al-Qudsi
46bd0e66b6 fixup! Clean up completions a little bit
Reverts some changes that broke sudo completions, and adds comments
clarifying the purpose behind sudo completions.

Closes #5004.
2018-05-22 17:44:52 -05:00
Mahmoud Al-Qudsi
0a337a9d8e Clean up completions a little bit 2018-05-20 14:07:56 -05:00
Mahmoud Al-Qudsi
4be4932786 Fix unzip completions directory completion 2018-05-20 12:33:41 -05:00
Mahmoud Al-Qudsi
5bd121bd6d Fix unzip completions for non-Linux platforms 2018-05-20 12:04:22 -05:00
Alexander Skwar
9401d3a6d5 Fix fish-shell issue #4996: open -a works now on non-english installs 2018-05-20 21:14:10 +08:00
Alexander Skwar
e6aacd6167 Fix fish-shell issue #4993 - support pathname completion for open -a command. 2018-05-20 21:14:10 +08:00
Mahmoud Al-Qudsi
9ddba0116f Add completions for unzip 2018-05-20 01:22:16 -05:00
Mahmoud Al-Qudsi
1c4940c04c Make sudo completions _much_ smarter
Now dynamically generating completions for the target of the `sudo`
command, where possible.
2018-05-17 20:19:31 -05:00
Fabian Homborg
560985cdee Remove test invocations with implicit -n tests
This is something we would like to remove - #2037.
2018-05-17 13:24:26 +02:00
Mahmoud Al-Qudsi
18a163dc24 Simplify argument completions for ttx and meson 2018-05-13 20:00:58 -05:00
Mahmoud Al-Qudsi
e197e57a7f Clarify ttx completion file table naming case sensitivity 2018-05-13 14:05:57 -05:00
Mahmoud Al-Qudsi
1bdf61cb20 Add completions for meson build system 2018-05-13 13:59:03 -05:00
Mahmoud Al-Qudsi
20395339a4 Fix python{,2,3} argument completions
Only the first non-switch parameter to python must be a .py file, but
everything thereafter is "just another argument". This enables file
completions for 2nd+ arguments.
2018-05-12 23:40:40 -05:00
Mahmoud Al-Qudsi
82c8abc4dc Add completions for ttx 2018-05-12 14:06:03 -05:00
Fabian Homborg
84fe46e763 [make completions] Reenable files if token contains "="
Fixes #4967.
2018-05-12 18:52:51 +02:00
Fabian Homborg
9929acd9d8 Revert "Use git ls-files to generate completions for git"
While this is a bit faster (mostly because it needs less processing on fish's side),
it lacks the neat description bit and the ":/" stuff doesn't work.

The boost is also not large in absolute terms (a few milliseconds).

This reverts commit 1f8e4dad9f.
2018-05-11 16:00:45 +02:00
Mahmoud Al-Qudsi
1f8e4dad9f Use git ls-files to generate completions for git
This uses the same logic that git uses to determine the satus of files
and doesn't require any parsing on our end. Brings in support for
relative paths (such as `git add ../f<TAB>`). Should be faster and more
reliable than manually parsing porcelain status.

This doesn't support as many cases as the old `__git_ls_files` function
did (e.g. `renamed` is not supported, nor is `added`), both of which
_can_ be implemented on top of the new logic - but neither of which were
actually being used, anyway.

Usefulness is decreased by #4970, speed still bottlenecked by #4969.

cc @faho
2018-05-10 14:04:20 -05:00
Fabian Homborg
1e3d26f744 [git completions] Remove impossible error message
We already read the rest into a "_" garbage variable.
2018-05-08 23:16:39 +02:00
Fabian Homborg
183b7f7017 [git completions] Complete deleted files after "--" for "reset" 2018-05-08 23:16:10 +02:00
Fabian Homborg
39e3c3c0b1 [git completions] Readd "unique remote branches"
This is based on what the official git completions do, and it's quite
fast.

Also only complete files after a "--" separator for `checkout`.

Fixes #4858.
2018-05-08 23:14:49 +02:00
Fabian Homborg
34fc390e13 [git completions] Shorten commit SHA ourselves
This is much quicker - on the order of 100ms vs 50ms.

We shorten to 10 characters, which is statistically suitable - 3 out
of 600k commits in the linux kernel need 11 characters.
2018-05-08 23:12:13 +02:00
Mahmoud Al-Qudsi
91f75d84d3 Completions for optipng 2018-05-06 18:55:12 -05:00
Luc J. Bourhis
d652b9b606 Use --tool-help to find available tools for difftool/mergetool 2018-05-06 13:12:42 -07:00
Luc J. Bourhis
d7a9e25e17 Completion of git difftool and git mergetool: add missing options 2018-05-06 13:12:42 -07:00
ridiculousfish
762c31be87 Feature flag support for ? wildcard
This partially reverts 6e56637cf0 and #4520
by bringing back the ? wildcard, guarded by the qmark-noglob feature flag.
2018-05-06 11:20:15 -07:00
ridiculousfish
7cbc0c371a Remove a "common fish problems" section in the docs
This wasn't really that common.
2018-05-06 11:19:58 -07:00
Ray Juang
ba68efd543 Updating adb completion to enable tab-completing file paths for adb shell and pull commands 2018-05-03 16:41:04 +02:00
Fabian Homborg
d8b1f0715f [pip* completions] Silence stderr
For some reason, these tools print an upgrade message to stderr, even
when stdout goes somewhere else.
2018-05-03 11:32:18 +02:00
Fabian Homborg
e598cb235a Fix case matching literal ?
Fixes #4896.
2018-04-25 23:37:39 +02:00
Fabian Homborg
f3f2d2d191 [git completions] Speed up branch completion
Using `git for-each-ref` both simplifies the code (no need to deal
with detached heads anymore) and speeds it up.

With 1600 branches, the time goes from ~48ms to ~16ms.
2018-04-25 23:11:40 +02:00
Wilke Schwiedop
0b0e65a8a4 Update ebuild.fish
greatly simplify __fish_seen_ebuild_arg
2018-04-25 15:46:15 +02:00
Wilke Schwiedop
29b67030b8 add completion for 'ebuild' command 2018-04-25 15:46:15 +02:00
Wilke Schwiedop
9d9966b156 add completion for 'equery files' filter switch 2018-04-25 15:46:15 +02:00
Wilke Schwiedop
80e30bc144 add argument completion for 'equery keywords' 2018-04-25 15:46:15 +02:00
Wilke Schwiedop
06cda3f0b0 fix 'equery uses' completion 2018-04-25 15:46:15 +02:00
Wilke Schwiedop
92fa94aa09 Improve equery completion
- fix capitalization
- shorten descriptions
- implement subcommand shortcuts
- add arg completion for 'limit' and 'depth' switches
- improve arg completion for list subcommand in case of -p switch
2018-04-25 15:46:15 +02:00
nblock
809b2cd792 Add completion for MkDocs (#4906)
* Add completion for MkDocs

* Use __fish_seen_subcommand_from
2018-04-25 15:45:48 +02:00
George Christou
0fdc51beed completions: [git] Add options for diff and show 2018-04-24 10:57:00 -07:00
Mahmoud Al-Qudsi
a9e9af5c5d Include devDependencies in yarn and npm completions 2018-04-20 23:05:31 -05:00
Mahmoud Al-Qudsi
a733296980 Correct bower and yarn completions
bower was calling `__fish_should_complete_args`, the old name for
`__fish_should_complete_switches.`
yarn was parsing bower.json instead of package.json.
2018-04-20 09:12:34 -05:00
Mahmoud Al-Qudsi
5f82cb5ca4 Use jq to iterate over installed dependencies for yarn completions
Only if available, else fall back to fragile package.json parsing.
2018-04-19 18:15:33 -05:00
Mahmoud Al-Qudsi
e48722f0bf Add completions for bower
These are "true" completions, with dynamic completion of available
packages to be installed or removed.
2018-04-19 18:09:11 -05:00
George Christou
342d0644ac completions: [git] Don't try to complete files when not in a repo 2018-04-19 17:15:21 +02:00
Mahmoud Al-Qudsi
77134fc49d Use all-the-package-names to complete yarn add 2018-04-19 08:35:06 -05:00
Mahmoud Al-Qudsi
503427255e Drop automation of all-the-package-names install for npm completions
Selectively reverts 156d4fb9b9.

`all-the-package-names` is still used to generate completions for `npm`
if it is installed, but it is not manually installed nor updated. It is
now the user's responsibility to do both, and it must be installed
globally.
2018-04-19 08:34:46 -05:00
J Delaney
54959a8248 Completions for merging 2018-04-19 14:34:01 +02:00
George Christou
97f2eca571 completions: [git] Add common options for show and diff 2018-04-19 14:31:49 +02:00
Mahmoud Al-Qudsi
156d4fb9b9 Complete npm package names for npm install via all-the-package-names
`npm search` was _way_ too slow to be used for dynamic completions, so
using a cached list of all avaialable NPM packages to match against.

This is a bit brave for a fish completion, but the npm package
`all-the-package-names` has a list of, well, all the package names
avaialable for installation via the default npm registry. Installing a
copy locally to $HOME/.cache/fish/npm_completions and using that to
search for packages matching the tokenized command line.

Preference would be to call `__update_atpm` in the background, but that
emits an ugly "job has completed" message..

Should also use this for completions for `yarn add`.
2018-04-18 22:42:46 -05:00
Mahmoud Al-Qudsi
c2e66b002a Dynamically invoke yarn completions so they aren't cached
Correct `-a (something)` to `-a '(something)'`
2018-04-18 21:43:39 -05:00
Mahmoud Al-Qudsi
6c5e5d35a9 Add real completions for ./configure
This relies on the new `read --line/-L` support as an entire parser for
the output of `./configure --help`  was written in fishscript. Also
doesn't work without 72f32e6d8a7905b064680ec4b578c41dea62bf84.

The completion script is slow... a function of both the autotools
configure script itself being written in a shell script combined with a
fishscript output parser.

fish's own `./configure --help` takes around 350ms to execute, while
`__fish_parse_configure ./configure` (which runs that behind the scenes)
takes around 660ms to run, all-in-all - a not insignificant overhead.

Output can be cached (based off of ./configure hash or mtime) in the
future if this is a big deal.
2018-04-17 21:35:51 -05:00
Kevin Ballard
9216544437 Add completion for --case-sensitive flag to history 2018-04-14 21:45:25 -07:00
Mahmoud Al-Qudsi
a2cb9cceaf Erase default autojump completions in j.fish completions
The default completions that autojump ships with for fish are broken
(emitting output like "1\___\#...") as they use hackes to work around
the previous lack of `complete -k`. The history-based autojump
completions fully replace it.
2018-04-14 23:23:33 -05:00
Mahmoud Al-Qudsi
facdc88c0c Improve completions for ssh by completing from history 2018-04-12 22:28:50 -05:00
Wilke Schwiedop
5d01399586 add file readability-test 2018-04-09 01:09:49 +02:00
Wilke Schwiedop
8ae9b716a0 fix 'grep ... | sed' 2018-04-09 01:09:49 +02:00
Wilke Schwiedop
bd24e8662e fix 'sort | uniq' 2018-04-09 01:09:49 +02:00
George Christou
6c0f31d622 completions: [git] Use builtin git truncation 2018-04-09 01:07:52 +02:00
Fabian Homborg
01f24f2df6 Fix typo in emacs completions
Fixes #4885.

[ci skip]
2018-04-09 00:46:35 +02:00
Mahmoud Al-Qudsi
c492d03f51 Overhaul completions for set and add new completions for set -e
Now the description includes the variable scope, `set [-e] -[Ugl]`
completions only provide variables matching that scope, and completions
that shouldn't be modified are hidden from the user. Completions that
are often modified but rarely unset (`fish_*` variables) are omitted
from `set -e` completions.

A new helper function `__fish_seen_argument` has been added that makes
it easy to only provied completions for a specific flag.
2018-04-03 14:42:26 -05:00
ridiculousfish
358e9def5b Fix the git completion
Commit 6e56637cf ran fish_indent on the git completion and mangled some
of it. Manually revert the non-essential changes.
2018-04-02 10:26:40 -07:00
Peter Ammon
7659554dea Remove use of caret redirection from share/*
This removes the use of caret redirections from share/completions
and share/functions, in preparation for dropping support in fish.
2018-04-01 13:42:38 -07:00
ridiculousfish
6e56637cf0 Remove support for the ? wildcard
Fixes #4520
2018-03-31 16:54:50 -07:00
Luc J. Bourhis
c116843611 Completion for conda, the package manager (#4837)
* Completion for conda, the package manager

* Make the list of platforms a private variable

* Add commands activate and deactivate

* Avoid clobbering a user-defined function __

* Use Use __fish_seen_subcommand_from to identify subcommand

And treat the case of the first argument as a special case
with function __fish_conda_fist_arg

* Factor out create from loop for option --name

* Fix typo (missing parenthesis in description)

* Start from a blank state by removing completions from conda configuration script
2018-03-26 17:07:23 +02:00
Daniel Beckwith
7583d57b63 Add Makefile --file detection to completion 2018-03-23 22:45:40 -07:00
Wilke Schwiedop
44e2c28255 revisit gentoo-related completions (#4758)
* revisit gentoo-related completions

- add completion for emaint
- improve completion for emerge
  still incomplete, but an impovement regardless
- improve completion for equery
- add gentoo/portage-related auxiliary functions

* fix spelling

* remove trailing '.'

* remove old '_' invocation and capitalize descriptions

* add number-completion

* remove trailing '.'

* shorter descriptions

* replace sed with fish-builtin and drop deduplication

* batch change capitalization (lower case)

* indent equery descriptions

* batch change capitalization (upper case)
2018-03-23 19:42:30 +01:00
Fabian Homborg
316303d777 [subl completions] Take files with new-window
Fixes #4831.

Thanks @luc-j-bourhis.
2018-03-17 21:06:44 +01:00
Laurent Pireyn
5732aeac9a Create completion for JBake 2018-03-15 21:59:23 +08:00
Fabian Homborg
228c5c1319 [git completions] Filter unreplaced $PWD
Otherwise this'd let the full filename through if it isn't in $PWD.
2018-03-14 10:56:59 +01:00
Lee Dohm
3ec1fab7aa Update to handle latest Atom options (#4801)
* Update to handle latest Atom options

* Fix typo and wording
2018-03-13 14:12:35 +01:00
Fabian Homborg
b2d887860a [git completions] Speed up __fish_git_files with lots of files
- Cache translations instead of calling `gettext` once per file

- Only do the ":/" thing if the file isn't in $PWD/**

For a git repo created like

```fish
git init
touch a(seq 0 1000)b
```

this changes the time from about 2s to 0.3s.
2018-03-13 13:47:17 +01:00
Fabian Homborg
4057cfdce5 [git completions] Minor cleanup 2018-03-13 13:45:37 +01:00
Fabian Homborg
bc976a913c [git completions] Use staged files for rm --cached 2018-03-13 13:45:03 +01:00
Fabian Homborg
8b4ac66349 [git completions] Reremove stray "[" 2018-03-13 13:44:36 +01:00
Mahmoud Al-Qudsi
c24739d3bd Use git ls-files instead of local files for git rm --cached
`git rm --cached` is often used to delete a file that no longer exists
in the working tree but remains in git's index. `git ls-files` will list
files that are in the HEAD, which is exactly what we want. Local files
not in `HEAD` can't be deleted from git anyway.
2018-03-12 19:22:41 -05:00
Mahmoud Al-Qudsi
c51abd04ff Clean up $__fish_*dir variable names
Closes #4429
2018-03-12 08:34:20 -05:00
Giovanni Bajo
3b7d759d11 Update completions for go
The tool subcommand had a "-f" flag to disallow file completions which is wrong: most of the tools there require a file/directory argument.

Since we're here, also limit "go tool compile" to only match Go source files.
2018-03-12 20:34:35 +08:00
Daniel Apolinario
cc80951e79 Completions for bb-wrapper and powerpill
Completions for bb-wrapper (bauerbill) and powerpill
2018-03-10 18:31:29 +01:00
George Christou
4ae6843b6b completions: [git] Fix rogue bracket typo (#4799) 2018-03-10 18:30:43 +01:00
ridiculousfish
9a5afe3913 Clean up and document functions --handlers 2018-03-10 02:27:25 -08:00
Mahmoud Al-Qudsi
eaa5958b77 Update completions for read builtin
Change short option for `--shell` to `-S` per #4490 and add description for -s/--silent
2018-03-09 11:59:50 -06:00
George Christou
73f2b444ef completions: [git] Do not decorate reflog 2018-03-07 22:01:23 +01:00
Mahmoud Al-Qudsi
b50541c655 Add comment about checking if jq exists in a future update to yarn completions 2018-03-06 17:03:15 -06:00
Fabian Homborg
88cf7e16c6 [git completions] Sort tags newest-first
This has the nice effect of sorting "2.7.0" before "2.7b1".
2018-03-06 22:06:39 +01:00
Fabian Homborg
5cb3918c1c [git completions] Remove unnecessary helper function 2018-03-06 22:06:39 +01:00
Fabian Homborg
f3c864a9e2 [git completions] Offer unmerged files for add
These occur e.g. when resolving a conflict, which then needs `git add`.
2018-03-06 22:06:39 +01:00
Fabian Homborg
b24971dc9e [git completions] Only offer files for log --
After a "--" separator, `git log` only takes files.
2018-03-06 22:06:39 +01:00
Fabian Homborg
754b52bb26 [git completions] Make branches work on git 2.7.0 again
This used the "--format" option, which was only added in git 2.13.0.
2018-03-06 22:06:39 +01:00
Mahmoud Al-Qudsi
a85d2bf27a Add intelligent package completion to yarn
Now parses package.json and uses results to provide a list of possible
completions to `yarn remove`. There may be other subcommands that could
benefit from this.

Could have parsed yarn output, but yarn is slow and packages.json format
is generally standard since it's machine-generated json.
2018-03-05 08:28:19 -06:00
Kevin Konrad
8536a6825f add completion for MacPorts 2018-02-24 23:32:25 +08:00
Jordi Burguet-Castell
0cd934ea63 apt.fish: add completions for "depends" and "rdepends" 2018-02-20 22:38:48 +11:00
Benoit Hamon
54c9d57e42 Ansible completions (#4697)
* 🚀

* prepare to merge into fish-shell

* split into different files

* remove deprecated option

* captitalize descriptions

* make shorter description for ansible

* update ansible-playbook (and ansible for consistency)

* update version on vault and galaxy
2018-02-06 17:53:23 +01:00
Fabian Homborg
7d60d1db6d [git completions] Remove unique-remote-branches
This never worked properly (since a branch that only exists locally
would also be offered) and is dog-slow.

When we come up with a better way to do it we can readd it.
2018-01-31 21:55:22 +01:00
Fabian Homborg
18e21a0992 [git completions] Complete branches faster
This saves one `git branch` invocation and improves the descriptions.
2018-01-31 21:55:18 +01:00
Fabian Homborg
0ab437be26 [git completions] Make paths not in $PWD relative to the root again
When git prints a path like "share/completions/git.fish", that's
relative to the root of the repo. So we need to either remove
everything from the $PWD (if the path is inside the $PWD), or prepend
a ":/", which is git-speak for "relative to the root".

This was removed by mistake in the recent switch to `git status`.

Fixes #4688.
2018-01-31 11:25:13 +01:00
Fabian Homborg
4fac2f98c2 [git completions] Use status v1 output
Apparently the v2 format is too new (released Nov 2016), and the v1
format has everything we need.
2018-01-31 11:25:13 +01:00
Fabian Homborg
e3a2eadb49 Remove obsolete "--gui" option from gradle completions
Fixes #4691.

[ci skip]
2018-01-29 19:31:12 +01:00
Mahmoud Al-Qudsi
d11f9f7148 Fix git push REMOTE :BRANCH completion
The `string match` was limiting it to `git push REMOTE :<TAB>` and would
fail for `git push REMOTE :x<TAB>`. Now working as expected.
2018-01-25 20:32:20 -06:00
Fabian Homborg
ea897fcc0f
git completions: Parse git status --porcelain (#4673)
* git completions: Parse git status --porcelain

This is much faster on large repositories, as it allows us to do a lot
more with a single git call.

It also makes it easy to add descriptions to distinguish modified
files from untracked ones.

TBD is if all commands now have the right kinds of files.

[ci skip]
2018-01-25 13:35:00 +01:00
Birger J. Nordølum
2ba76a7115 diskutil.fish: added apfs completions, and tweaks to old ones 2018-01-23 19:25:12 +01:00
Yurizal Susanto
a6536db502 Update Eopkg support (#4662)
Update Eopkg support

Improve Eopkg completions
2018-01-22 14:25:34 -08:00
Birger J. Nordølum
fde647214d brew.fish: added cask completion & tweaks 2018-01-18 18:05:14 +01:00
David Adam
85131452fa apt: add completions for policy
Closes #4652.
2018-01-13 11:03:36 +08:00
MindTooth
721df61f4b brew.fish: add the leaves option (#4645) 2018-01-06 12:39:15 +01:00
pinage404
1af4acbd0e Add: ngrok completions (#4642)
Completions are based on the help messages of [ngrok](https://ngrok.com/)
2018-01-05 15:30:58 +01:00
emiliano
3cabed88e2 Add --no-color to more git invocations (#4636)
This breaks when git has been set to always print in color.
2018-01-03 14:35:27 +01:00
Fabian Homborg
3650712ff2 python completions: Disable file completion
Otherwise the prior commit was pointless.
2018-01-01 13:18:55 +01:00
Mahmoud Al-Qudsi
0aa4c4a483 Add git completions for git push REMOTE :BRANCH
`git push REMOTE :BRANCH` deletes remote branch BRANCH from remote
REMOTE. Should only kick in when the pattern matches, hopefully didn't
break anything else!
2017-12-28 14:26:40 -06:00
Yurizal Susanto
94ff789c4b Add eopkg completion support (#4600)
* Add eopkg support

Add support for eopkg in __fish_print_packages function, and
add new completion eopkg.fish in share/completions

* Sorry for the empty file

* Sorry for the empty file again

* Use builtin function for checking subcommand and options

* Fix description

* Use string function to replace grep and cut

* Add completion for search command
2017-12-21 16:43:21 +01:00
David Guyot
dcf9ce6fc5 Added completions/translations for zfs and zpool 2017-12-21 16:39:06 +01:00
Fabian Homborg
edcf9ebc12 [git completions] Remove staged_files function
Turns out "__fish_git_staged_files" does the same thing as "__fish_git_modified_files --staged".

Also use "--staged" instead of "--cached", which is a more
understandable synonym.

Many thanks to @thomcc on gitter.
2017-12-18 20:05:56 +01:00
Niraj Thapaliya
0c2d939e02 yarn run tab completion
completes #4597
2017-12-14 22:58:08 -06:00
Niraj Thapaliya
7cd9c3b2bf Clean trailing whitespace 2017-12-14 22:09:53 -06:00
PenegalECI
0f587320ed Added translations for mdadm completions (#4587) 2017-12-12 22:24:02 +01:00
Ron Gebauer
7aaf897a72 Add modified completion for git diff (#4592)
* Add modified completion for git diff

* Add modified completion for git diff
2017-12-12 22:16:43 +01:00
Aaron Bieber
75e17e007d add signify completions for OpenBSD 2017-12-12 19:19:09 +01:00
Aaron Bieber
37c7950a3f add vmctl completions for OpenBSD 2017-12-12 19:19:05 +01:00
Aaron Bieber
eec47a173d add rcctl completions for OpenBSD 2017-12-12 19:19:01 +01:00
Aaron Bieber
e135024cc4 add pkg_info completions for OpenBSD 2017-12-12 19:19:01 +01:00
Aaron Bieber
e57f5cc99b add pkg_delete completions for OpenBSD 2017-12-12 19:19:01 +01:00
Aaron Bieber
8bfd3fa144 add pkg_add completions for OpenBSD 2017-12-12 19:19:01 +01:00
Aaron Bieber
53e08cd0d6 add OpenBSD pfctl completion 2017-12-12 19:18:57 +01:00
Mohammad Ali Alfarra
ba04c2af3d Add exercism completion 2017-12-11 10:44:06 +01:00
Aleksey Filippov
4bcd0413f8 do not execute external command in pkill completions (#4586)
Running "cut" multiple times in a loop has an adverse performance
impact on first use, especially on slow systems. Using builtin "read"
for the same purpose is faster and cleaner.
2017-12-10 21:56:29 -08:00
Tony Wang
7d055a120e fix patch completion
patch -i should be followed by a filename, and patch -d should be
followed by a directory
2017-11-29 12:15:43 +01:00
Ron Gebauer
a4fced2a8b Create jhipster.fish
Add completion for jhipster
2017-11-26 19:21:46 -08:00
Ron Gebauer
ce4fdbaf7c Create bd.fish
Add completion for bd, per https://github.com/0rax/fish-bd
2017-11-26 19:21:37 -08:00
David Guyot
b917f168d3 Improved french translations; minor completion corrections 2017-11-23 11:02:32 +01:00
Laurent Pireyn
b46b0310f3 Create Hugo completion (#4529) 2017-11-12 21:03:11 -08:00
Andrew Schulman
ed0a57ff6d Update cygport completions 2017-11-08 22:19:52 +01:00
Fabian Homborg
60248e895f Use __fish_complete_user_at_hosts
for various completions.

This makes the code a bit nicer, removes one of the
__fish_print_hostnames calls (which are slow) and a sed call, thereby
improving performance by about 33% (600ms to 400ms).

Fixes #4511.
2017-11-08 12:59:31 +01:00
Fabian Homborg
1cd43a371b Add "chsh -l" completion for util-linux chsh
AFAICT, the FreeBSD and macOS option of the same name isn't useful
with chsh, so we skip that.

Fixes #4497.
2017-10-25 20:55:05 +02:00
Laurent Pireyn
3781862346 Fix typo in gradle completion (#4500) 2017-10-23 20:04:47 -07:00
Mahmoud Al-Qudsi
e1c90cac88 Prevent error output on invocation of rustc completions
fish was indiscriminately calling `rustc -Z help` in the autocompletion
script for `rustc`, but `-Z` (and its `-Z help` output completions) is
only available when using the nightly compiler.

Note that this isn't a perfect fix since if you try to use those command
line options now added to the autocompletions list without using the
nightly toolchain, `rustc` will still throw an error. But at least this
way we don't cause random errors about `-Z` not being available to
appear any time someone tries to use `rustc` from the fish command prompt.
2017-10-18 11:49:40 -05:00
Fabian Homborg
5196354176 git completions: Allow files for git rm
Fixes #4485.
2017-10-18 13:37:13 +02:00
evuez
6d350409b3 Add --follow-tags completion for git push (#4462) 2017-10-12 05:59:52 -07:00
Aaron Gyes
68527ff20c completions: --description -> -d
This ends up saving a surprising number of bytes.
2017-10-11 10:17:35 -07:00
Aaron Gyes
020f8097f0 uniq completions: fix spelling
it's -> its
2017-10-11 10:08:05 -07:00
Mahmoud Al-Qudsi
1a3adf086d Coalesce string trim and string match in flatpak completions 2017-10-11 06:23:02 +02:00
Aaron Gyes
59dbc7ca6a Tweak ninja completions 2017-10-09 01:22:20 -07:00
Mahmoud Al-Qudsi
21473b20ec Update flatpak completions to work with latest flatpak
Closes #4456
2017-10-09 07:30:19 +02:00
Mahmoud Al-Qudsi
b61c4f1cbc Correct string replace usage in pip2/3 completions
\b does not match "end of spaces" but rather "start of a-z/0-9" and so
does not match the start of string '-c'. Match (and then re-insert) a
literal ' ' as part of the pattern instead.
2017-10-05 13:54:47 +02:00
Mahmoud Al-Qudsi
04bde6cf5b Document reasons for commmand name replacement in pip2/3 completions
(cherry picked from commit 429bdce4f1)
2017-10-05 13:33:45 +02:00
Mahmoud Al-Qudsi
78fe53406e Fix copy-and-paste pip3 -> pip2 typo
Thanks @floam. See #4448
2017-10-05 13:26:56 +02:00
Mahmoud Al-Qudsi
7e48f5cc4f Use string replace instead of sed with better regex for pip completions
(cherry picked from commit d74d3f2ca4)
2017-10-05 13:25:14 +02:00
Mahmoud Al-Qudsi
af12bcb117 fixup! Force correct names for pip2/pip3 command in completions 2017-10-05 13:11:14 +02:00
Mahmoud Al-Qudsi
b11ca2c01c Force correct names for pip2/pip3 command in completions
Work around bug pypa/pip#4755
Don't expect all users to be running a version of pip2/3 that includes
the fix (once it's upstreamed). Will continue to work if/when pip2/3
emit the correct output. pip is already very slow at printing the
completions (see #4448) so the `sed` call overhead is neglible.
2017-10-05 13:03:24 +02:00
Gabriel Birke
6ce03a4a36 Add script completion for composer
When no command is given or when using "run-script" parse composer.json
and look for the "scripts" section. Complete script names.
2017-10-05 10:47:34 +02:00
Aaron Gyes
d740b2a473 pip completions: use builtin source rather than eval function. 2017-10-04 21:50:09 -07:00
Cristian Prieto
1770e47eb0 Python's pip and pipenv completions (#4448)
* Add pip completion

 * We call native pip completion for fish if pip is installed

* Add pipenv completion

 * We call pipenv native completion if pipenv is installed

* Applied changes as requested by @floam

 * Changed usage of `test (command -v)` for just `command -sq`

* Add completions for pip2/3

 * In some systems pip is not aliased and we have pip2 and pip3
 * In those cases, we just load the completions for those commands

* Separate pip2/3 completions in their own file as requested by @floam
2017-10-04 21:15:41 -07:00
Mahmoud Al-Qudsi
2dd2867a61 Implement limits for __history_completions in j completions 2017-10-04 17:52:58 +02:00
Fabian Homborg
281d468285 Rewrite systemctl completion with argparse
This

- Offers more candidates

- Is more reactive (it'll always incorporate "--state=" and "--type="

- Is faster (about 800ms to about 120ms)

- Needs fewer function files

All __fish_systemctl_* functions except __fish_systemctl_services have
been removed.
2017-09-29 20:07:18 +02:00
Mahmoud Al-Qudsi
fa9e445342 Add history-based completions for autojump's j command
j does not have any "logical" source of completions, but it almost often
called with arguments that have been seen before (since it is used to
jump to favorite/recent directories). We can search the history for
possible completions and use those.

This is an example of the behavior mentioned in #4344 as a possible
enhancement for fish 3.0, where completions can be provided from history
if none are otherwise found.
2017-09-20 20:50:10 -05:00
Mahmoud Al-Qudsi
864a1893bc Squashed commit of the following:
commit e07f1d59c06094846db8ce59f65d4790b222fffa
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Sun Sep 10 21:54:45 2017 -0500

    Use git branch and git branch --remote for checkout completions

commit 9e1632236be065e051e306b11082ca4e9c7a0ee1
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Sun Sep 10 11:27:30 2017 -0500

    Correct classification of remote and local branches

    To prevent any breakage, no changes were made to __fish_git_branches,
    instead its output was filtered into __fish_git_remote_branches and
    __fish_git_local_branches, the two of which are now used to provide
    completions for "git checkout ..."

    Fixes #4395

Closes #4396
2017-09-14 13:42:06 -05:00
Mahmoud Al-Qudsi
856c9cf8a1 Make s3cmd completions compatible with python3 environment
It seems that under python3, s3cmd emits its output as a long list (like
ls -l) with or without the --long parameter to "s3cmd ls s3://...".

This patch includes only s3://* paths from that output as completions.
2017-09-14 13:39:12 -05:00
ridiculousfish
a5fd0b317e Revert "Switch to bare vars in our math invocations"
This reverts commit bd18736ee5.

Bare variables should only be used in commands that must
manipulate the variable stack, such as `set`.
2017-09-09 23:35:47 -07:00
Mahmoud Al-Qudsi
bca17db96e Preserve git's own ordering of branch/tag completions for checkout
Addresses the main concern of #3830 by preserving the internal ordering
of tag/branch listings generated by git. Fixes mixing of remote and
local branches in completions.

Does not address the concern of having local branches on top, remote
branches after, and tags at the bottom - I don't believe we have that
functionality available to us yet. #361 only implemented sort within a
category of completions, but there is no category "weight" unless I'm
mistaken.
2017-09-09 23:35:04 -05:00
Moritz
6145b4a770 Add completions for git checkout --ours/--theirs (#4380)
* Add completions for git checkout --ours/--theirs

* Change description for `git checkout --ours/--theirs´ completions
2017-09-07 16:24:05 +02:00
Fabian Homborg
c2f0a45d60 git completions: Use modified files in the index for reset
Fixes #4329.
2017-09-06 10:25:58 +02:00
Marcel Bischoff
c0c33b3605 Add basic ezjail-admin completion 2017-09-06 09:55:14 +02:00