Fabian Homborg
4e2b11f2e0
help: Fix error if no argument is given
2017-08-14 18:18:10 -07:00
Mahmoud Al-Qudsi
fa4cf77aff
Ignore more invalid arguments from parsed man pages
...
Specifically closes #4313 .
Not being as agressive in what we ignore/blacklist, but can be revisited
easily in the future to add more characters to the argument blacklist.
2017-08-14 18:18:09 -07:00
Kurtis Rader
3a506543b6
Merge branch 'master' into major
2017-08-07 18:52:00 -07:00
Radek SPRTA
74cac0f86f
completions for snap
command
2017-08-07 18:47:37 -07:00
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