Commit graph

12208 commits

Author SHA1 Message Date
Rosen Penev
202fe39d34 fix unreachable code warning
Found with clang's -Wunreachable-code

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-12 17:02:17 -07:00
Jason Nader
d278ff4e45 Use the new string split --fields feature 2020-04-12 14:01:21 -07:00
Weisi Dai
07fb55d342 fish_indent: Add notes on SPACES_PER_INDENT. 2020-04-12 13:43:45 -07:00
David Adam
3bb374319a debian packaging: recommend python3-distutils for web config
Reported downstream as
https://bugs.launchpad.net/ubuntu/+source/fish/+bug/1867615
2020-04-11 22:18:31 +08:00
exploide
ee180988d1 sftp completions 2020-04-11 13:24:35 +02:00
Shun Sakai
4f60693037 Add completions for Zopfli 2020-04-11 13:13:56 +02:00
Charles Gould
8029f15f1f git prompt: better check for git stashes
When you run "git gc":

 - .git/refs/stash is deleted
 - .git/logs/refs/stash is kept intact
2020-04-10 00:22:16 +02:00
xnumad
af5a9cf88e It's wget --bind-address
Fixes typo
2020-04-09 23:49:27 +08:00
Mahmoud Al-Qudsi
c249b1f2f0 Also catch zero-index errors when indexing into a command substiution
We had previously added a more helpful error message when a literal zero
index was specified when indexing into an array. This patch extends that
coverage to cases indexing into a command substitution, e.g.

```fish
echo (printf "hello\nworld\n")[0]
```
2020-04-07 20:05:50 -05:00
Artur Juraszek
33bc2bc312 Allow unzip versions not patched by Debian to enjoy .{jar,aar} completions
A minor follow-up to #6866 (e658a88ab0).
These file types should be properly handled by other unzip flavors too,
regardless of Debian's/non-Linux Unixes' idiosyncrasies.
2020-04-07 22:47:38 +02:00
exploide
8025e80fdb new function __fish_preview_current_file to open file at the cursor in pager
bound to Alt+O by shared key bindings
created with help from @krobelus
fixes #6838
2020-04-07 22:30:05 +02:00
Johannes Altmanninger
77d33a8eb9 Ignore SIGINT and SIGQUIT in non-interactive background processes
Fixes #6828
2020-04-07 22:18:15 +02:00
Johannes Altmanninger
90f67e4009 fish_test_helper: print only blocked 64 blocked signals
Otherwise it would print "Unknown Signal" on Linux.  I didn't see an
obvious way to check signal validity, plus it hardly matters.

Also mimic the output from BSD strsignal on Linux.
2020-04-07 22:18:15 +02:00
Johannes Altmanninger
c1b2b6b7da Rename comp_empty to complete_did_insert and fix comments 2020-04-06 23:43:29 +02:00
Fabian Homborg
f0f162f07e argparse test: Tighten regex against travis' shenanigans
Travis puts the commit message in an environment variable, so if it
contains the string `_flag` this would match TRAVIS_COMMIT_MESSAGE.

That happened in ca91c201c3, so the
tests failed.

We simply tighten the regex a little more, and make a commit message
that doesn't include the string.
2020-04-06 19:57:22 +02:00
Lior Stern
ca91c201c3 Remove unnecessary string duplication in handle_flag_f.
Prevents a memory leak.
2020-04-06 19:13:48 +02:00
Thom Chiovoloni
39e0fd14eb Allow man completions on catalina if apropos is overridden
It's pretty easy to fix catalina's apropos with a small tweak, so it
would be nice if man completions worked if this is done.
2020-04-06 19:13:12 +02:00
Thom Chiovoloni
e658a88ab0 Support .jar and .aar files in unzip completions
I've been dealing with these a lot recently (android dev...), and it's
pretty annoying that unzip completions don't recognize them (They're
just zip files with a weird file extension).
2020-04-06 19:12:03 +02:00
Fabian Homborg
ff68bdceba Allow file completions for more builtins
- contains
- count (for `count *`)
- echo
- printf
- random (for `random choice`)

Fixes #6520
2020-04-06 18:59:10 +02:00
Fabian Homborg
4eccc0f6d1 true/false: Stop erroring out for arguments
For `true`, this makes uses like the

    : some description of the job &

we used to have impossible, also it's just *wrong* that true can
return something that isn't true.

For false it's not super important but it should generally be
symmetrical with true.
2020-04-06 18:56:19 +02:00
Fabian Homborg
6a721fab63 Let . and : be completed with files
For `.` it's *correct* and for `:` it literally accepts everything
2020-04-06 18:56:10 +02:00
Fabian Homborg
5dfaff4281 Make "." a builtin as well
Yeah, it's not going anywhere. This is one line in builtin.cpp vs 9
lines of script, most of which used to print an error that is never triggered.
2020-04-06 18:55:59 +02:00
Fabian Homborg
be0de5e2de Just define a ":" builtin
It's *less code* to define this as a builtin, and it's not going
anywhere. Plus it makes fish just a little more usable without share/config.fish.
2020-04-06 18:55:59 +02:00
ridiculousfish
3df05af809 Revert "Do not prevent multiple tab-completions with the same command line"
This reverts commit 41dcf84386.

This seems to have broken a lot of interactive scenarios.
2020-04-05 19:05:53 -07:00
ridiculousfish
41dcf84386 Do not prevent multiple tab-completions with the same command line
The comp_empty variable was assigned a sucecss value, leading fish
to think that the set of completions was empty when it is not.

Fixes #6863
2020-04-05 18:55:28 -07:00
Ron Gebauer
77fb54fa99 In Fish MD5 on BSD now use given String and not -s
Signed-off-by: Ron Gebauer <ron.gebauer@raytion.com>
2020-04-05 17:25:02 -07:00
ridiculousfish
866d506d11 Add a fish_test_helper command to print blocked signals 2020-04-05 15:07:42 -07:00
Rosen Penev
385b069eb2 [clang-tidy] remove pointless public
Found with readability-redundant-access-specifiers

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:43 +02:00
Rosen Penev
68467eeca7 [clang-tidy] remove redundant string initialization
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
473a5250ae [clang-tidy] change several member functions to const
Found with readability-make-member-function-const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
312b575424 [clang-tidy] numeric literals to uppercase
Found with hicpp-uppercase-literal-suffix

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
194fa4a548 [clang-tidy] performance
Found with performance*

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
8d3377e923 [clang-tidy] Use C++ using instead of typedef
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
be036c443e [clang-tidy] use bool literals
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
27f607ae8b [clang-tidy] use range based loop
Found with modernize-loop-convert

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Rosen Penev
220f0a132d [clang-tidy] use auto when casting
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-04-05 10:13:13 +02:00
Fabian Homborg
b42445e675 Restyle create_manpage_completions 2020-04-05 10:13:02 +02:00
Lior Stern
d7aeac3c61 Add clang-tidy to build_tools/lint.fish 2020-04-04 14:47:58 -07:00
Lior Stern
321e1ed26a Check that parser is not nullptr before calling libdata.
Avoids a possible nullptr dereference in
parse_execution_context_t::check_end_execution
2020-04-04 14:47:58 -07:00
Lior Stern
1b23e5471d check the value of nodeptr in tnode_t::source_range.
Avoids a possible nullptr dereference
2020-04-04 14:47:58 -07:00
Lior Stern
d6e2110cdf Add a clang-tidy file. 2020-04-04 14:47:58 -07:00
Soumya
639ea3caa0 Update docs for fish_kill_signal, use "job" rather than "command" 2020-04-04 19:23:44 +02:00
Johannes Altmanninger
89c4ff9eae Fix some inconsistencies in docs 2020-04-04 19:19:50 +02:00
Johannes Altmanninger
fd18cba4bc Add completions for builtin wait 2020-04-04 19:19:50 +02:00
Johannes Altmanninger
bd91497de2 Refactor read_init, it is not meant to fail 2020-04-04 19:19:50 +02:00
Fabian Homborg
af03f2ce6d create_manpage_completions: Switch to argparse
This is a lot cleaner and more easily extendable.
2020-04-04 15:30:09 +02:00
Fabian Homborg
6e95e1d79d create_manpage_completions: Change "--save" to "--keep" 2020-04-04 15:30:09 +02:00
JanczarKnurek
f212aba174 Allow not to remove files from destination dir
Signed-off-by: JanczarKnurek <jacek@beit.tech>
2020-04-04 15:30:09 +02:00
Jason Nader
30459b053f more dogfood 2020-04-04 15:30:09 +02:00
Jason Nader
eaf313f755 Dogfooding to show off use case 2020-04-04 15:30:09 +02:00