Commit graph

2288 commits

Author SHA1 Message Date
Kurtis Rader
55bef3cd2e remove deprecated . (dot) command
Fixes #4294
2017-08-07 18:31:20 -07:00
Mahmoud Al-Qudsi
0ebff8c516 Addresses #4292 by removing custom completions for source builtin
The source builtin should use the default path completion and isn't
restricted to *.fish files by wrapping ..fish
2017-08-07 17:49:28 -07:00
Kurtis Rader
1e67baf00e Merge branch 'master' into major 2017-08-07 17:49:02 -07:00
Alexey Alekhin
326f2affa4 Fixed functions -D/--details completion 2017-08-07 17:43:05 -07:00
Sam Yu
d87c0424d8 Speedup git prompt
Fix __fish_git_prompt too slow under repo with lots of untracked
files when __fish_git_prompt_showuntrackedfiles enabled.
2017-08-06 13:24:33 -07:00
Sam Yu
0988f53c70 Speedup git prompt
Fix __fish_git_prompt too slow under repo with lots of untracked
files when __fish_git_prompt_showuntrackedfiles enabled.
2017-08-04 20:43:07 -07:00
Kurtis Rader
8b79f4e5c9 use the new set -a and set -p in our scripts 2017-08-04 18:02:24 -07:00
Kurtis Rader
d4fb75e9f3 fix bug in abbr function
I introduced a bug in the `abbr` function with commit 17dff8c by
referencing the undefined `$cmd` variable. This fixes that.
2017-08-03 23:52:07 -07:00
Kurtis Rader
17dff8c569 rewrite abbr function
Rewrite the `abbr` function to store each abbreviation in a separate
variable. This greatly improves the efficiency. For the common case
it is 5x faster. For pathological cases it is upwards of 100x faster.
Most people should be able to unconditionally define abbreviations in
their config.fish without a noticable slow down.

Fixes #4048
2017-08-03 14:35:06 -07:00
Kurtis Rader
7e0833c1e0 Merge branch 'master' into major 2017-07-31 22:15:44 -07:00
Raoul Wols
8e3a9c9585 Add Sublime Text 3 completions 2017-07-31 22:09:06 -07:00
Kurtis Rader
1a55e9ba60 Merge branch 'master' into major 2017-07-29 21:58:15 -07:00
Daniel K
d68b631919 fix check for existing variable 2017-07-29 21:18:44 -07:00
Kurtis Rader
4e026588f4 modify prev commit to use builtin cd
Using the `cd` function can have undesirable side effects like mucking
with the directory history. So force the use of the builtin cd.
2017-07-27 14:36:32 -07:00
Kurtis Rader
defdc92b57 fix ssh config Include file handling
Fixes #4253
2017-07-27 14:36:32 -07:00
Mahmoud Al-Qudsi
34c2bf0f55 Using new complete --keep-order option for __fish_git_recent_commits
The primary motivation for --keep-order for `complete` was to support
something like commit history completions, which are returned by git in
reverse chronological order and make no sense alphabetically (they are
SHA1 hashes).

See https://github.com/fish-shell/fish-shell/issues/361 for more info.
2017-07-26 13:18:34 -07:00
Thales Mello
a071deaf61 Make npm run-script completion faster with jq (#4241)
* Make npm run-script completion faster with `jq`

When jq is available, it's actually faster to invoke jq and parse the `package.json`
invoking the `npm` command.

Also, prior to this commit, both `__fish_complete_npm` and `__fish_npm_run` were being run
whenever completions for `npm run` subcommand was being used, which was actually making
repetitive work (invoking npm command twice). This pull request is supposed to make completion
without `jq` faster as well

* Refactor npm.fish for code reutilization

Created function to handle both cases of npm run completion parse, with or without `jq` completion.

* Remove unecessary blank line
2017-07-26 13:31:35 +02:00
Kurtis Rader
92f39f7b89 fix bug introduced by commit 86af63cd3 2017-07-25 14:03:40 -07:00
Kurtis Rader
35a7db50a2 fix bug introduced by commit 86af63cd3 2017-07-25 14:02:50 -07:00
Kurtis Rader
8e87d595b7 remove some uses of $IFS
This is a step towards resolving issue #4156. It replaces uses of `$IFS`
with other solutions.
2017-07-24 20:45:43 -07:00
Mohamed Akram
d2d707a6fa Ignore comments when creating man page completion 2017-07-22 21:32:56 -07:00
Fabian Homborg
7304d82416 Fix file completion for tail 2017-07-22 14:09:34 +02:00
Raphael P
3fc0faaebb Update completions for heroku pg:backups
heroku pgbackups has been deprecated and replaced by heroku pg:backups command.
See: https://devcenter.heroku.com/changelog-items/623

Completion for new subcommand has been added as well.
2017-07-22 11:08:15 +02:00
Kurtis Rader
d068f846e8 simplify history function
The fix for #4232 allows us to simplify the `history` function slightly.
2017-07-21 16:26:15 -07:00
Kurtis Rader
d376cb316f simplify history function
The fix for #4232 allows us to simplify the `history` function slightly.
2017-07-21 16:25:03 -07:00
Fabian Homborg
e0f0164b16 Quote $USER when used with switch or test
Common in prompts, this would fail if $USER is empty.

See #4229.
2017-07-20 19:45:32 +02:00
Kurtis Rader
0dc92fbb2d a make style-all cleanup 2017-07-18 22:40:25 -07:00
Kurtis Rader
69ecda5082 update math to use the new argparse validation 2017-07-18 15:03:08 -07:00
Kurtis Rader
4e1303823b add ability for argparse to validate args
Fixes #4211
2017-07-18 14:42:50 -07:00
Kurtis Rader
403d9691cb fix handling of ssh aliases
Fixes #4213
2017-07-17 21:13:21 -07:00
Kurtis Rader
8f22def8f7 return to psub --file being the default
The recent change to switch `psub` to use `argparse` caused it to use
a fifo by default because it inadvertently fixed a long standing bug in
the fish script. This changes the behavior back to `psub --file` being
the default behavior and introduces a `--fifo` flag. It also updates the
documentation to make it clearer when and why `--fifo` mode should not
be used.

Fixes #4222
2017-07-17 14:33:51 -07:00
Kurtis Rader
3e226f0a5e implement a new implicit int option spec
While updating the `history` function to use `argparse` I realized it is
useful to define an option that can be used in three ways. First by
using the short flag; e.g., `-n NNN`. Second by using the long flag;
e.g., `--max NNN`. Third, as an implicit int flag; e.g., `-NNN`. This
use case is now supported by a spec of the form `n#max`.
2017-07-16 18:27:41 -07:00
Kurtis Rader
c22df3b823 update history to use argparse 2017-07-16 15:13:39 -07:00
Kurtis Rader
f2c8e73891 add more alias unit tests
A recent regression to the `alias` command points out the need for more
unit tests of its behavior. I also decided to use it as an opportunity
to normalize the output of just `alias` to list aliases.
2017-07-15 17:36:36 -07:00
Kurtis Rader
98449fec51 fix math regression
The previous change to use `argparse` for parity with every other
builtin and function introduced a regression. Invocations that start
with a negative number can fail because the negative value looks like an
invalid flag.
2017-07-14 16:03:31 -07:00
Kurtis Rader
ff4d275f22 remove left over debug statement 2017-07-14 08:18:41 -07:00
Kurtis Rader
49a0841533 update type to use argparse 2017-07-13 15:19:02 -07:00
Kurtis Rader
51bbecc419 update realpath to use argparse 2017-07-13 14:33:11 -07:00
Kurtis Rader
3e6c57d5d3 update psub to use argparse 2017-07-13 14:12:51 -07:00
Kurtis Rader
30940916bd update prompt_pwd to use argparse 2017-07-13 14:12:51 -07:00
Kurtis Rader
51a52a7286 update open to use argparse 2017-07-13 14:12:51 -07:00
Kurtis Rader
e8243af20b update math to use argparse 2017-07-13 14:12:47 -07:00
Kurtis Rader
140e6204be update help to use argparse 2017-07-13 13:49:15 -07:00
Kurtis Rader
86af63cd39 update funcsave to use argparse 2017-07-13 13:35:26 -07:00
Kurtis Rader
6ecd0bcb32 update funced to use argparse 2017-07-13 13:29:35 -07:00
Kurtis Rader
df65ed8696 update dirs to use argparse 2017-07-13 11:53:29 -07:00
Kurtis Rader
30baf8d101 convert dirh to use argparse 2017-07-13 11:50:57 -07:00
Kurtis Rader
f156bea1b7 convert alias to use argparse 2017-07-13 11:47:41 -07:00
Kurtis Rader
05aae4764b convert popd and pushd to use argparse 2017-07-13 11:31:08 -07:00
Kurtis Rader
5ac8c42fad convert nextd to use argparse
Also fix a bug I introduce in `prevd` when I converted it to use `argparse`.
2017-07-13 11:30:48 -07:00
Kurtis Rader
3a782003ed have argparse report the proper command name 2017-07-12 22:38:32 -07:00
Kurtis Rader
abef2cc422 convert nextd to use argparse 2017-07-12 22:38:32 -07:00
Kurtis Rader
5cf2a50269 convert isatty to use argparse 2017-07-12 22:38:32 -07:00
Kurtis Rader
3c4e3035fd switch from getopt to argparse
Convert our two functions that use `getopt` to use our new `argparse`
builtin.

Fixes #4190
2017-07-12 22:38:32 -07:00
Kurtis Rader
a4dc2b872b implement fish_opt helper command
This implements a `fish_opt` command that provides a way for people
to create option specs for the `argparse` command as an alternative to
creating such strings by hand.

Fixes #4190
2017-07-12 22:38:32 -07:00
David Marchal
bd5c98298c Added completions for passwd 2017-07-11 17:10:24 +02:00
David Marchal
e1951a32bb Fixed __fish_complete_users to better format GECOS 2017-07-11 17:00:08 +02:00
PenegalECI
c577d01207 Add completions for mdadm (#4198)
* Added completions for mdadm

* Applied changes requested by @faho and @krader1961
2017-07-10 17:13:35 +02:00
Kurtis Rader
8cc4639ea6 implement cdh command
Fixes #2847
2017-07-05 13:25:18 -07:00
tamanugi
6b92f830ff Use __fish_complete_user_at_hosts 2017-07-05 16:24:45 +02:00
tamanugi
170f11771b Add function __fish_complete_user_at_hosts
This function list hostnames;
if commandline hoge@~ , it list hoge@(hostname)
2017-07-05 16:24:45 +02:00
tamanugi
70c9d78536 Add fab completions 2017-07-05 16:24:39 +02:00
Fabian Homborg
d6a9d6c59e git completions: Add missing quote
Fixes #4187.
2017-07-05 15:04:44 +02:00
Kurtis Rader
83ecf84392 harden git completion against an undef var 2017-07-04 17:34:52 -07:00
Kurtis Rader
4853ec0281 harden psub again an undef TMPDIR 2017-07-04 16:35:32 -07:00
Kurtis Rader
8caab103d8 harden man against undef vars 2017-07-04 13:56:35 -07:00
Kurtis Rader
2df89f4b0f check if $fish_color_cancel is set before using it 2017-07-04 13:56:35 -07:00
Fabian Homborg
9fb7037174 fish_key_reader: Add --version option
This should be there anyway, and we try to find fish_key_reader for
.app bundles, so this stops us from defining aliases to the command.

See #4179.
2017-07-04 22:55:47 +02:00
Kurtis Rader
f6d101e7ad fix undef var reference in history
The change for issue #4163 brought to light the pointless attempt to use
`$_` in the `history` function.
2017-07-03 16:26:27 -07:00
Kurtis Rader
0ec9acf0f0 harden abbr against undef vars
This is only needed if we make undefined vars an error as proposed in
issue #4163 but it's a good idea anyway.
2017-07-03 13:05:50 -07:00
Kurtis Rader
763063e741 more changes to better handle undef vars
This is only needed if we make undefined vars an error as proposed in
issue #4163 but it's a good idea anyway.
2017-07-03 10:16:31 -07:00
Kurtis Rader
4f345fdee7 harden *share/config.fish* against an unset var
This is only needed if we make undefined vars an error as proposed in
issue #4163 but it's a good idea anyway.
2017-07-02 21:16:48 -07:00
Kurtis Rader
ea38519a12 fix var name in __fish_git_prompt
Var `___git_ps_color_suffix_done` is supposed to be
`___fish_git_prompt_color_suffix_done`. This bug was found by an
experimental change to detect the use of undefined variables (#4163).

Similarly, we should simply test whether `__fish_git_prompt_showcolorhints`
is set rather than set to a non-empty string.
2017-07-02 20:49:40 -07:00
Kurtis Rader
85b42b22f4 define __fish_active_key_bindings before using it 2017-07-02 13:41:40 -07:00
Kurtis Rader
3284393aba cleanup some undefined var references
Testing a fix for #4163 revealed some questionable dereferencing of
variables that are not certain to be defined.
2017-07-02 13:41:40 -07:00
Sam Yu
6f6a4a842c Fix typo in zypper.fish 2017-06-30 14:46:43 +02:00
Fabian Homborg
3b5fdc3fb0 git completions: Fix aliases with weird characters
A use for the new `string escape --style=var`.

Fixes #4147.
2017-06-28 23:21:33 +02:00
Fabian Homborg
db529f06b8 type: Use command -a 2017-06-28 23:13:36 +02:00
Kurtis Rader
bb29f9f990 replace __fish_urlencode with string escape
We now have a builtin that can do URL escaping so use it. I can't find
any uses of our private `__fish_urlencode` function in any Oh-My-Fish or
Fisherman code so remove it.
2017-06-23 22:46:36 -07:00
Kurtis Rader
30368d5526 implement status function when in a breakpoint
Another step to fixing #1310. This changes means that `status -L0
function` reports the correct function when inside a breakpoint.
2017-06-23 22:14:21 -07:00
Hector Sanjuan
2d42baac35 Fix last status report (it's always 0)
It seems something is overwriting the status before it is
saved to a variable. Fixed by setting the last_status variable
at the very beginning.
2017-06-22 14:01:19 +02:00
Kurtis Rader
df01547eab implement the fish_breakpoint_prompt function
This is another step to resolving issue #1310. It makes
`fish_breakpoint_prompt` a replacement for `fish_prompt` if it is defined
and we're presenting a prompt in the context of a `breakpoint` command.
2017-06-20 17:18:59 -07:00
Kurtis Rader
bd299e96b2 implement status is-breakpoint
This implements `status is-breakpoint` that returns true if the current
shell prompt is displayed in the context of a `breakpoint` command.

This also fixes several bugs. Most notably making `breakpoint` a no-op if
the shell isn't interactive. Also, typing `breakpoint` at an interactive
prompt should be an error rather than creating a new nested debugging
context.

Partial fix for #1310
2017-06-20 17:18:59 -07:00
Rabah Meradi
d234a1870b Aucompletion for jest CLI 2017-06-19 23:27:22 -07:00
Fabian Homborg
1a135aa0b0 git completions: Make checking aliases faster
See #4117.
2017-06-19 11:04:40 +02:00
Clément Martinez
d5e1405cbe Add as completions 2017-06-18 23:10:23 -07:00
Kurtis Rader
af22bf3501 style cleanups (make style-all) 2017-06-16 21:01:57 -07:00
Fabian Homborg
cec2999983 Allow help to open the tutorial
This is unambiguous because all the anchors in tutorial.html begin
with "tut".
2017-06-14 13:52:24 +02:00
Fabian Homborg
82359ceb22 Update help completions
- More topics
- Some non-existent topics (todo/bugs) removed
- Some rewording (no more "Help on")
2017-06-14 13:40:14 +02:00
Clément Martinez
be1d32cade Add grub-install completions 2017-06-14 12:41:38 +02:00
Clément Martinez
a69537ea13 Add grub-file completions 2017-06-14 12:41:38 +02:00
Dale Eidd
2b4f61f294 Fix echo "no wildcard match" complaints for ssh completions etc 2017-06-10 14:06:20 +02:00
Dale Eidd
5b3904e66b Fix not including main ssh config in host names search 2017-06-10 14:06:20 +02:00
Clément Martinez
6161f54111 Add dhcpcd completions 2017-06-10 14:05:38 +02:00
Kurtis Rader
1f24432172 fix typo in error message 2017-06-09 12:12:36 -07:00
Daryl Roberts
a0c8a9e8ed update the node options for __fish_not_contain_opt to not have the "--" in front of their flags 2017-06-09 12:11:10 -07:00
Fabian Homborg
edaef4e6b0 Fix stray quote in magento completions
Fixes #4108.
2017-06-07 11:35:12 +02:00
Kurtis Rader
352cea1659 disable/enable bracketed paste by edit cmd buf
We need to disable/enable bracketed paste mode around running the editor
from within the `edit_command_buffer` function.
2017-06-05 11:32:06 -07:00
Kurtis Rader
5ef8b91db8 fix three explicitly translated messages 2017-06-02 20:40:58 -07:00
George Christou
5e39efa45b Fix ln file completion 2017-06-01 19:06:32 -07:00
Kurtis Rader
b8aacc29cd remove redundant output from __fish_complete_cd
Fixes #4085
2017-06-01 18:55:41 -07:00
Kurtis Rader
ee646c8dd0 move set -l to top of function
Fixes #4091
2017-06-01 17:58:29 -07:00
Martin Pelikan
65b0b947c9 Remove redundant/non-existent bind forward-kill-word 2017-06-01 17:50:05 -07:00
Kevin Ballard
3061eed647 Fix usage of osascript in help
Work around a macOS osascript bug in 10.12.5 which prevented help from
working. See #4035.
2017-05-31 23:01:31 +08:00
Kevin Ballard
5c140e5570 Revert "Use open instead of osascript in help"
This reverts commit f234637e53.
2017-05-31 23:01:31 +08:00
mascafidi
4c47fbc964 Add Expert Options to DUP command completion 2017-05-30 22:38:15 -07:00
ridiculousfish
2f5af733ba Use open instead of webbrowser.open on macOS >= 10.12.5
Works around an osascript bug. Fixes #4035.
2017-05-30 20:53:59 +08:00
ridiculousfish
f234637e53 Use open instead of osascript in help
Work around a macOS osascript bug in 10.12.5 which prevented help
from working. Fixes #4035.
2017-05-30 20:53:59 +08:00
Fabian Homborg
0fc9ec5538 type: Fix "-a"
This matched _all_ executable commands, where it should only match all
executable commands _with the given name_.

Fixes #4070.
2017-05-26 23:58:35 +02:00
Fabian Homborg
4afd41877f Fix various expansions in cd completions
This actually used the built-in file-completion logic as a fallback
for e.g. tilde-expansion (stuff like `cd ~/V`).

Fixes #4061.
2017-05-26 16:57:42 +02:00
Kevin Ballard
9bc1b44b0d Handle missing groff macro in __fish_print_help
The Xcode installation of Fish is missing the groff macro used by
`__fish_print_help`. This caused e.g. `status -h` to stop working.

Fixes #4058.
2017-05-23 19:57:18 -07:00
Kevin Ballard
4ff002b9fb Turn off bracketed paste when Fish exits 2017-05-23 17:36:09 -07:00
Kurtis Rader
a71bb03f23 fix killall completions
This fixes the obvious error in handling the `-u` short flag.
See issue #4052.
2017-05-22 20:17:08 -07:00
Fabian Homborg
036b708d99 help: Properly error out when no browser is found
See #4045.
2017-05-18 22:51:57 +02:00
Mo
71f5fe1ece Added Magento2 CLI completions (#4043)
* Added Magento2 CLI completions

This is the completion file for the Magento2 CLI application I use on my servers. It has an additional feature tho, I'm not sure if it fits into the fish completion philosophy:  
If you provide limited access credentials, it will connect to the MySQL database and provide additional suggestions, such as available users, themes or indexers in the database. If this file is never touched, those suggestions simply won't show up. I, personally, find them to be pretty useful, though.  

Should I remove those database suggestions before creating a PR?

* Removed functions using MySQL, updated formatting

* Several smaller fixes

* Improved descriptions

Tried to shorten the text as much as possible and removed unnecessary characters
2017-05-18 17:05:49 +02:00
Sven Sternberger
cbd9181b7e Update __fish_print_hostnames.fish
For Ubuntu the default global known host files are :
/etc/ssh/ssh_known_hosts  
/etc/ssh/ssh_known_hosts2
2017-05-17 16:59:18 +02:00
Alan Somers
3aa42389ef Fix syntax error in gphoto2 completions 2017-05-15 21:53:56 -07:00
Jonas Damtoft
573c539956 Gradle-completions for gradle tasks (#3972)
* Implement https://github.com/hanny24/gradle-fish/blob/master/gradle.load

* Use XDG_CACHE_HOME

* Use __funced_md5

* Fix fish_md5.fish

* Actually use the new function.

* Use string match for matching tasks

* I goofed. Actually pass a string to complete -a

* Fix attempt to remove needed function...

* Fix regex

* Fix fish_md5.fish to use a flag
2017-05-13 13:28:32 +02:00
Fabian Homborg
573e1ad4b1 type: Remove TODO
[Ci skip]
2017-05-11 15:24:47 +02:00
Clément Martinez
f0a00ab2f2 Add mkdosfs completions 2017-05-08 19:16:06 +02:00
Sebastian Keller
6620b9ec72 Add gsettings completions 2017-05-08 19:14:47 +02:00
Fabian Homborg
8814f34dc1 Improve killall completions
- Remove UID resolution, since that can be slow.
- Remove a `uname` call by storing the result
- Stringify
- Indent

Fixes #3996.
2017-05-04 23:58:45 +02:00
Adriaan Zonnenberg
09ce297352 Add completions for caddy 2017-05-04 15:09:29 +02:00
Fabian Homborg
084a820de3 Stringify xrandr completions 2017-05-03 23:36:43 +02:00
Fabian Homborg
c06a71bfbe Stringify hg completions 2017-05-03 23:36:25 +02:00
Fabian Homborg
044d45a0ff Stringify adb completions
Also reindent.
2017-05-03 23:35:34 +02:00
David Adam
d3cfab1391 webconfig: apply colour syntax highlighting to functions tab
Closes #1432.
2017-05-03 08:37:27 +10:00
David Adam
1e9caecbcb webconfig: import angular-sanitize module
Enables use of ngBindHtml.

Work on #1432.
2017-05-03 08:37:27 +10:00
Fabian Homborg
f5fac096c0 Don't move cursor in delete-char
Instead, move forward and backward in vi-mode.

Fixes #3899.
2017-04-28 22:53:03 +08:00
David Bishop
2565c5c15b Use $suffix in classic_vcs prompt instead of hardcoding to '>'
Also, ensure that suffix is local in both classic_vcs.fish and informative_vcs.fish.

Fixes #3991
2017-04-26 16:01:52 -07:00
Fabian Homborg
77201ade34 __fish_complete_users: Also test for command, not path 2017-04-25 17:36:22 +02:00
Fabian Homborg
49d3a58a9e __fish_complete_users: Use command, not a hardcoded path 2017-04-25 12:47:23 +02:00
Kurtis Rader
37508d1f1e refactor the __*_users functions
Per my comment in issue #3980 this implements `__fish_print_users` in
terms of `__fish_complete_users` so we don't have to modify both when a
change to how users are enumerated is needed.
2017-04-23 20:08:40 -07:00
Christian Rondeau
bea0b17c9e Aucompletion guards for /etc/passwd #3980 2017-04-23 19:41:07 -07:00
Fabian Homborg
ec92e91ddc fish_clipboard_paste: Turn \r into \n
We already do this in bracketed-paste because it's really confusing to
have a \r literal in the commandline.
2017-04-23 13:40:40 +02:00
Fabian Homborg
cc7d83fa94 fish_clipboard_paste: Fix multiline pasting 2017-04-23 13:38:32 +02:00
Fabian Homborg
17ba21cfe4 Fix pasting backslashes
Another missing escape.

Fixes #3981.
2017-04-23 13:32:24 +02:00
Alex Gaynor
f30c50cec5 [hg completions] remove a grep and use hg's native query syntax
This has the side benefit of working around a wild bug with readline+fish that I've reported to the upstream readline developers. (The result of that bug is that the hg processes are constantly being leaked as `bg` jobs in the shell, which is how I came to notice this in the first place)
2017-04-21 18:56:54 +02:00
Fabian Homborg
805a177673 __fish_config_interactive: Prefer python3
Also includes the CHANGELOG.
2017-04-21 13:45:49 +02:00
Fabian Homborg
e410d47565 fish_config: Pick a python
Also remove a use of `eval` and `string escape`.

Fixes #3970.
2017-04-21 13:45:49 +02:00
Fabian Homborg
7ef2d5e86f fish_update_completions: Pick a python
This removes a need for packagers to either patch our shebangs or pick
a particular python.

This was already done in __fish_config_interactive (where we need to
duplicate the code because it involves backgrounding).

Work towards #3970.
2017-04-21 13:45:49 +02:00
Kurtis Rader
b9d2e4d897 fix fish greeting regression
Fixes #3973
2017-04-20 20:17:50 -07:00
Fabian Homborg
cb9f4e621f lua completions: Try harder to find libraries
Fedora puts them in /usr/lib64 without having /usr/lib as a symlink.

Also silence errors (in case a directory doesn't exist) and stringify.

See https://bugzilla.redhat.com/show_bug.cgi?id=1442628.

CC @amluto.
2017-04-20 14:00:30 +02:00
Fabian Homborg
7c6600895e Add missing options to functions completion 2017-04-19 23:11:35 +02:00
Francisco Giordano
349eff0df7 change cancel_commandline function to use color from variable
This allows the user to define how they want the "^C" rendered when a
pending command line is interrupted.
2017-04-17 21:16:42 -07:00
Ivan Trubach
a9db99ac52 Rename replace-one to replace_one
Fixes invalid character in variable name $fish_cursor_replace-one (used by fish_vi_cursor[_handle]) by renaming bind mode 'replace-one' to 'replace_one'.
2017-04-17 21:10:23 -07:00
Adam Byrtek
e7d686461e Terraform completions (#3960)
* Basic Terraform completion supporting all commands

* Option completion for Terraform commands

* Search command line in reverse order

* CHANGELOG entry

* Fix `terraform untaint` completion

* Use common completion functions to handle subcommands

* Use imperative form and remove CHANGELOG changes
2017-04-17 17:18:39 +02:00
Adam Byrtek
dd69ca5a81 Warn when function is not modified by the editor after calling funced (#3961)
* Check whether tmp file was modified in `funced`

* More idiomatic error messages

* Store the checksum in a local variable

* MD5 function supporting both GNU and BSD

* Use `else if` in MD5 function

* Use `string` builtin instead of `cut`
2017-04-17 17:18:02 +02:00
Kurtis Rader
dcc081a594 mark __fish_sgrep as deprecated
Fixes #2450
2017-04-15 21:51:33 -07:00
Kurtis Rader
75f1e36b44 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:49:08 -07:00
Kurtis Rader
b3617cfd86 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:30:36 -07:00
Kurtis Rader
a381d959f2 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:29:07 -07:00
Kurtis Rader
ae03df4bc4 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:22:09 -07:00
Kurtis Rader
9d25b52208 a step to remove __fish_sgrep per issue #2450 2017-04-15 21:01:03 -07:00
Kurtis Rader
d48c872913 a step to remove __fish_sgrep per issue #2450 2017-04-15 20:59:09 -07:00
Kurtis Rader
4936de29e7 a step to remove __fish_sgrep per issue #2450 2017-04-15 20:23:48 -07:00
Kurtis Rader
3463e81dda a step to remove __fish_sgrep per issue #2450 2017-04-15 20:04:43 -07:00
Kurtis Rader
a3cd5bf170 a step to remove __fish_sgrep per issue #2450 2017-04-15 18:32:30 -07:00
Kurtis Rader
cc3efcc3ab a step to remove __fish_sgrep per issue #2450 2017-04-14 23:21:17 -07:00
Kurtis Rader
0be8d0d385 another __fish_sgrep replacement 2017-04-13 23:14:36 -07:00
Kurtis Rader
f20c7deaf1 a step to remove __fish_sgrep per issue #2450 2017-04-11 21:01:43 -07:00
Kurtis Rader
da09a915f2 improve __fish_complete_directories function
Reviewing a PR for a completion script caused me to look at the
implementation for the `__fish_complete_directories` function. Which in
turn lead me to create this change to improve its implementation and add
unit tests for the function.
2017-04-11 13:45:53 -07:00
Alan Somers
ed6298ad17 Fix portmaster completions when there are no matches
Don't spew warnings when there are no matches.  Also, use the string
builtin instead of calling sed.

Fixes #3949
2017-04-10 21:37:54 -07:00
Fabian Homborg
ddb9350ea9 Replace use of which with command -sq 2017-04-08 13:21:04 +02:00
Kurtis Rader
75600b6b53 fix setenv and add unit tests
Fixes #3937
2017-04-05 15:31:13 -07:00
SanskritFritz
2105bae1fc Completions for ipset 2017-04-01 01:52:05 +02:00
SanskritFritz
0c265c0f52 Obnam completions updated 2017-04-01 01:52:05 +02:00
SanskritFritz
cd8982b645 Obsolete completions removed 2017-04-01 01:52:05 +02:00
Kurtis Rader
62244f01c2 fix umask handling of symbolic modes
This fixes the handling of symbolic umask values. It also removes two
invocations of `perl` and all but two `math` commands.

Fixes #738
2017-03-28 16:28:24 -07:00
Fabian Homborg
4b9424eb20 type: Minor reformatting
Empty lines after `if` and `if begin`.
2017-03-28 15:55:10 +02:00
Fabian Homborg
c4d69ea8a1 type: Rewrite option parsing
Removes a call to `seq` and makes it a bit more readable.
2017-03-28 15:55:10 +02:00
Fabian Homborg
a3f28e221f type: Remove need for which
This should be completely equivalent without needing an external command.
2017-03-28 15:55:02 +02:00
Fabian Homborg
3d6c4adda9 Fix unescaped ' literals in bracketed-paste
This was a case of a missing \\.

Fixes #3913.
2017-03-26 09:33:11 +02:00
Fabian Homborg
83791a26c3 Stringify mkinitcpio completions
Also fixes an issue with the -k completions.
2017-03-21 01:31:26 +01:00
Fabian Homborg
70354f9f5e Add bind --list-modes option
Fixes #3872.
2017-03-20 16:42:53 +01:00
Kurtis Rader
536b1220fd cleanup __fish_complete_man.fish
I looked at this and noted some problems fixed by this change in
response to exploring if issue #726 was still unresolved.
2017-03-18 21:55:02 -07:00
Fabian Homborg
b6517250c7 vi-mode: \cd should do delete-or-exit
This just removes the special vi binding and hence falls back upon the
shared one.

Fixes #2219.
2017-03-17 12:07:10 +01:00
Fabian Homborg
99e87dded3 Auto-escape pastes inside single-quotes
This is to make pasting literals easier.

When a user pastes something, we normally take it as-is.

The exception is when a single-quote is open, e.g. the current token
is

    foo'bar

When something is pasted here, we escape single-quotes (`'`) and
backslashes (`\\`), so typing a `'` after it will turn it into a
literal token.

Fixes #967.
2017-03-16 16:08:13 +01:00
Kurtis Rader
6123d3cb50 document trap ... EXIT
Fixes #1180
2017-03-14 21:02:02 -07:00
Kurtis Rader
085a9b9267 fix stupid typo introduced by d9b30ab09 2017-03-14 13:17:53 -07:00
Kurtis Rader
d9b30ab090 setenv should behave like export
Fixes #3897
2017-03-14 12:14:22 -07:00
mus0u
b4f70cb98b include exit status indicator in robbyrussell sample prompt 2017-03-13 18:05:49 -07:00
Greynad
98f4e49669 Add string 'repeat' subcommand
This feature add the ability to repeat a string a given number of times.
For example: string repeat -n 3 foo
2017-03-12 20:30:36 -07:00
Fabian Homborg
db63be7909 Add support for bracketed paste
This is a terminal feature where pastes will be "bracketed" in
\e\[200~ and \e\[201~.

It is more of a "security" measure (since particularly copying from a
browser can copy text different from what the user sees, which might
be malicious) than a performance optimization.

Work towards #967.
2017-03-06 00:19:46 +01:00
Dan Zimmerman
f17ddb6770 Fix error when using tmux with vi mode 2017-02-28 19:05:05 +01:00
Clément Martinez
64fe617c63 Add gradle completions 2017-02-22 20:01:13 -08:00
Kurtis Rader
9dd0c47d0b harden alias against foo; bar
If the first word of the alias body ends with a semicolon we need to
strip that character, and otherwise escape the extracted command, to
ensure the subsequent function definition is valid.

Fixes #3860
2017-02-20 20:23:55 -08:00
Kurtis Rader
9f5ce04229 fix perl completions
Fixes #3856
2017-02-18 19:54:36 -08:00
Twinkle
a9617f97b6 enhance git repo for Robbyrussell prompt 2017-02-18 17:11:38 -08:00
Fabian Homborg
0a8c922d92 Use command -sq instead of redirection
This option has been available for a while now and it's a bit shorter.
2017-02-18 22:16:55 +01:00
David Adam
40de253b3a Upgrade git:// and http:// URLs to https://
Work on fish-shell/fish-site#47

[ci skip]
2017-02-17 21:31:44 +08:00
maxried
06b2775131 Improved adb completion
* Added reconnect and its subcommand
* Updated the sideload description and made its completion more advanced
* Silenced errors on backup and uninstall auto completion when no device is attached
2017-02-15 11:53:28 -08:00
Terje Larsen
22a2098c34 Add completions for helm (#3829)
* Add completions for helm

helm - is a tool for managing Kubernetes charts. Charts are packages of
pre-configured Kubernetes resources.

See: https://github.com/kubernetes/helm

* Improve helm release completions description

After some feedback from the community it seems it is good to include
the chart in the release description. This adds the chart information to
the description. So to say this is `Release of CHART`.

* Further improvements to helm completions

- Utilize complete -f, -r and -x properly
- Add some more context aware completions (chart versions, kubectl context and namespaces)
2017-02-13 17:23:29 +01:00
Alan Somers
ad6ea1691e Fix "mount -t" completions on non-Linux OSes
AFAICT Linux alone uses the "mount.XXX" convention for mount helpers.
Illumos, Irix, HPUX, OSX, and the BSDs all use "mount_XXX".

Fixes issue #3841
2017-02-12 18:05:37 -08:00
Kurtis Rader
813415302a fix clear screen invocation
It's necessary to use a subcommand to eat the newline that `string
replace` appends to the string.
2017-02-12 14:12:12 -08:00
Clément Martinez
cbea0b9378 mount & udisksctl: improve -o completions` (#3764)
* mount & udisksctl: improve `-o` completions`

* Update __fish_complete_mount_opts
2017-02-12 15:23:41 +01:00
Markus Reiter
f38646593c Allow export to set colon-separated PATH, CDPATH and MANPATH. 2017-02-12 15:20:07 +01:00
Fabian Homborg
9598218a94 Don't call fish in the background to generate completions
Fixes #3803 even harder.
2017-02-12 14:56:36 +01:00
Fabian Homborg
afdd1a98c1 Don't clear scrollback with the \cl binding
ncurses since 6.0 sends the "E3" sequence along with "clear", even for
just `clear` or `tput clear`. This deletes the scrollback buffer which
is usually not what you want.

Fixes #2855.
2017-02-12 12:01:28 +01:00
Fabian Homborg
52648acdc8 Check python version at runtime for completions
Some things like pyenv can change what `python` refers to, so what we
detect when we load the completions can become invalid later.

Also mentioned in #3840.
2017-02-11 16:07:06 +01:00
Fabian Homborg
f9664f224d Don't wrap pythonX completions
The issue here was that the `python` completion did a version check on
the `python` binary, so it would complete python2 stuff if system
python was py2, even if the user tried to complete `python3`.

This isn't beautiful, but it's more resilient than e.g. doing magic
with `commandline`.

Fixes #3840.
2017-02-11 16:07:06 +01:00
Markus Reiter
3e35e6e488 Use string split in alias. 2017-02-10 14:09:41 +01:00
Fabian Homborg
214c677032 Remove outdated completions
These are dead projects with completions that didn't provide much
value.

Fixes #3662.
2017-02-09 18:42:55 +01:00
Cristian Prieto
2bbecf4292 Yarn completion (#3816)
* Add main yarn commands and subcommands

* Add more short/long options

* Add subcommands for most main commands

* Add suboptions for mutext and access
2017-02-09 17:24:38 +01:00
Jeff Dickey
cf63d1b2a7 added mocha.fish 2017-02-08 14:22:30 -08:00
Kurtis Rader
0970cc8736 time for another make style-all 2017-02-07 21:52:35 -08:00
René Schwaiger
908ed493cc Fix wildcard bug in __fish_print_filesystems
Before this change the function `__fish_print_filesystems` would print
an error message about an empty wildcard match for the pattern
`$PATH/mount.*`, if the current operating system does not include any
helper binaries for the command `mount`. An example for such an OS is
the current version of macOS (version 10.12).
2017-02-06 08:08:54 -08:00
Rabah Meradi
a5e8b81ee3 Add completion for climate 2017-02-05 19:22:35 -08:00
ridiculousfish
8a09c99f36 Escape in vi mode to end paging, but stay in insert mode
Change the escape key binding in insert mode (in vi key bindings)
to check if we are in paging mode. If so, emit cancel and stay in
insert mode. Otherwise perform the current behavior of switching
back to default mode and adjusting the cursor.

Fixes #2871
2017-02-05 02:49:52 -08:00
Fabian Homborg
b3d5fb71f4 completion generator: Protect against undefined variable
Proc wasn't defined if $MANPATH was used.

Fixes #3808.
2017-02-03 18:32:14 +01:00
Fabian Homborg
94b71353ef completion generator: Define parent_paths directly if MANPATH is set 2017-02-03 18:32:14 +01:00
David Adam
49e98cde4c Merge branch 'Integration_2.5.0' 2017-02-03 21:14:40 +08:00
Clément Martinez
47ad707bba Add jq completions 2017-02-02 23:07:54 +01:00
Terje Larsen
bf84879134 Add completions for minikube (#3778)
* Add completions for minikube

This adds basic completions for minikube, the subcommands and their options.

* Improve minikube completions

- Use more consistent and shorter descriptions.
- Fix subcommand options
- Add more semantic completions

* Fix named variable for option value

* Add completions for minikube addons enable/disable

* Add completions for minikube addons open
2017-02-02 17:45:42 +01:00
Fabian Homborg
b7cdb6d586 Merge pull request #3757 from nim65s/master
systemctl completions: add cat & edit commands

Also use systemd version to determine the commands it knows.
2017-02-02 17:44:07 +01:00
Kurtis Rader
088b10f4c2 style fixes to previous commit
This commit addresses many of the style problems with the previous
commit. If this introduces any bugs they are solely my fault. The style
of this code needs more improvement. Some of which could be done today.
Others will have to wait until `fish_indent` is improved.
2017-02-01 22:49:40 -08:00
Dale Eidd
eff6b98813 numerous improvements to ssh/scp completions
Add IPV6 /etc/hosts completion support. Parses columns rather than values which produces improved output.

Support ssh -F and Include completion

Ignore ssh Hostname and Host with wildcard. The following only get in the way:

- Hostname: Host resolves to Hostname
- Wildcard Host: Cannot ssh to a glob pattern

Improve scp completions

* complete only local files when no host provided
* complete only remote files when host is provided
* complete local files or hosts when no separator

Disable username completion for ssh/scp

Username completion only provides local users which will unlikely be
useful on a remote machine. ssh will use the current username (the only
useful one) or one provided in the ssh config.
2017-02-01 22:12:49 -08:00
Clément Martinez
2b13472419 Improve htop completion
Add new options
Add description at the top of the file
Fix `--sort-key` completions
2017-01-31 15:52:55 -08:00
Clément Martinez
9d5471722f Improve help completions 2017-01-31 15:52:55 -08:00
Clément Martinez
0447ee7b96 Improve go completions 2017-01-31 15:52:55 -08:00
Clément Martinez
cd58e6129c Improve grep completions 2017-01-31 15:52:55 -08:00
Clément Martinez
0df65a106d Add setsid completions 2017-01-29 20:06:32 -08:00
Fabian Homborg
03e0f1eb21 create_manpage_completions: Try more ways to get manpath
Haiku only has `man --path`.

Still doesn't support OpenBSD.

Use $MANPATH if available. This needs to:

- Ignore stderr (we pipe it and throw it away)

- Read the subprocess returncode, since `man --path` is an existing
  command that fails instead of a non-existent one (that raises an
  exception)

- Properly set up the fallback

Fixes #2194.
2017-01-29 18:00:48 -08:00
Kurtis Rader
06282f02fd don't run fish_update_completions in unit tests
Running `fish_update_completions` in unit tests is not needed and
hideously expensive. To the point it can cause flakey test behavior.
2017-01-29 18:00:48 -08:00
Clément Martinez
61f272495d Add i3-msg completions 2017-01-28 19:48:57 +01:00
Cristian Prieto
7edfcd5c63 Add more options for git log
This closes #3743
2017-01-27 14:13:25 +01:00
Kurtis Rader
5b6cc5af6d time for another make style-all
Gotta keep the entropy (i.e., disorder) from increasing.
2017-01-26 20:05:46 -08:00
Fabian Homborg
98b561929f Add flatpak completions
A bit barebones, but better than nothing.
2017-01-26 22:04:27 +01:00
Fabian Homborg
f513f4e53a Add completions for xinput 2017-01-26 22:04:27 +01:00
Fabian Homborg
67a661c19f Fix dconf completions
This would always just suggest the commands.
2017-01-26 22:04:27 +01:00
Fabian Homborg
7d44f8e871 Add usermod completions
Fixes #3775.
2017-01-26 21:40:05 +01:00
Guilhem Saurel
e07928062f addressing comments 2017-01-26 00:01:34 +01:00
Clément Martinez
ec19159580 man completions: complete fish commands (#3762)
* man completions: complete fish commands

`apropos` does not output fish commands so they were not completed.

* Improve __fish_complete_man
2017-01-25 15:34:59 +01:00
Cristian Prieto
b7d60dc7bb Improve bzr completion (#3769)
* Improve bzr completion. Closes #3661

 * Add basic completion for bzr commands
 * Include short and log options for common commands
 * Removed not so common commands

* Remove trailing '.' as requested by #3769

* Remove '=' as suggested by #3769

 * We don't need '=' in long options

* Use fish helper functions for autocomplete

To avoid issues pointed out in #3769 helper functions included in fish
are used (__fish_use_subcommand and __fish_seen_subcommand).

* Fixed typo
2017-01-25 15:34:00 +01:00
Guilhem Saurel
fab4399b8c available completions for systemctl depends on its current version 2017-01-25 01:14:38 +01:00
Clément Martinez
3e10640c04 Add pv completions 2017-01-24 23:52:46 +01:00
Judicaël Grasset
730086b0f0 apt: Add completion for the autoremove subcommand (#3771) 2017-01-24 19:55:42 +01:00
Kurtis Rader
c9a409dcf3 deal with multiline commands which have flags
Fixes #3758

(cherry picked from commit 176a291ed2)
2017-01-23 09:11:06 +08:00
Kurtis Rader
176a291ed2 deal with multiline commands which have flags
Fixes #3758
2017-01-21 20:23:06 -08:00
Guilhem Saurel
1350b44ecf systemctl completions: add cat & edit commands 2017-01-22 03:22:29 +01:00
Clément Martinez
082d4b5a7e Add light completions 2017-01-21 00:33:58 +01:00
Fabian Homborg
c111a65622 Stack completions: Fix dead link
This was just reshuffled a bit. Now it uses the main page (which then
redirects to the docs anyway), which should be a bit more stable.
2017-01-20 21:46:59 +01:00
Fabian Homborg
e89c66a224 git completions: git push uses set-upstream
This was a misunderstanding in 96a28df. git _branch_ now uses
set-upstream-to, while git _pull_ still only has set-upstream.

Thanks @moverest.
2017-01-20 15:55:39 +01:00
Clément Martinez
85212c57e8 Add castnow completions 2017-01-19 21:59:59 -08:00
Fabian Homborg
5996962749 Use normal fish_title in Terminal.app
This needs to be done only for new enough Terminal.app versions, which
we don't have enough time to figure out for 2.5.0.

Fixes #3629.
2017-01-19 14:38:11 +01:00
Mehul Tikekar
59eb75021b Remove cd in __fish_print_interfaces 2017-01-18 15:44:28 -08:00
mathbunnyru
7a80610300 Delete trailing spaces 2017-01-15 14:57:21 -08:00
Kurtis Rader
8d32eb62ae reinstate some bindings for vi mode
Fixes #3731
2017-01-15 13:55:43 -08:00
Kurtis Rader
d37e7bcc25 reinstate some bindings for vi mode
Fixes #3731
2017-01-15 11:11:38 -08:00
Cristian Prieto
6f9f7632f3 Added default mode prompt function (#3727)
* Added new function for the default prompt mode

Now fish mode prompt will call fish_default_mode_prompt, this will solve #3641

* Added function description

* Change wording for documentation about default mode prompt

* Finish changes requested in code review
2017-01-12 16:07:41 +01:00