Commit Graph

10236 Commits

Author SHA1 Message Date
Wilke Schwiedop
34f50883a4 completions/ebuild: add pretend command 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
52450dc864 completions/emaint: fix logs command 2019-04-29 18:33:37 +02:00
Fabian Homborg
389f5074ad Add test for argparse crash
43929ced9
2019-04-29 17:03:16 +02:00
Fabian Homborg
43929ced90 src/builtin_argparse: Work around wgetopt crash
If on the last argument, and it was an unrecognized option, we can't
call `wgetopt_long()` again, or it'll crash.
2019-04-29 16:55:55 +02:00
Fabian Homborg
8c9359fdd4 src/builtin_argparse: Add --ignore-unknown flag
This keeps all unknown options in $argv, so

```fish
argparse -i a/alpha -- -a banana -o val -w
```

results in $_flag_a set to banana, and $argv set to `-o val -w`.

This allows users to use multiple argparse passes, or to simply avoid
specifying all options e.g. in completions - `systemctl` has 46 of
them, most not having any effect on the completions.

Fixes #5367.
2019-04-29 15:57:56 +02:00
ridiculousfish
d8ac051f89 Move selection_direction_t to pager.h and make it a class enum 2019-04-28 14:06:03 -07:00
ridiculousfish
3c9f95594a Update Dockerfile for cmake3 2019-04-28 11:41:37 -07:00
ridiculousfish
2507162f80 Revert "Add a test for autoload_t"
This reverts commit 51c62d6cc6.

Back out the test while I attempt to fix it
2019-04-27 20:14:06 -07:00
ridiculousfish
51c62d6cc6 Add a test for autoload_t 2019-04-27 16:16:48 -07:00
ridiculousfish
4ff50eba41 Remove autoload_t, rename autoloader_t to autoload_t
Now that there are no more clients of autoload_t, delete it and
rename autoloader_t to autoload_t. Also clean up the headers.
2019-04-27 15:47:08 -07:00
ridiculousfish
68a28106b2 Reimplement completion autoloading via autoloader_t
This switches the completion autoloading machinery to autoloader_t.
2019-04-27 15:37:24 -07:00
ridiculousfish
960266fe24 Reimplement the function store and autoloading
This cleans up how functions are stored and autoloaded. It eliminates the
recursive lock. Instead there is a single normal owning_lock that protects
the entirety of the function data. Autoloading is re-implemented via the
new autoloader_t.
2019-04-27 15:30:11 -07:00
ridiculousfish
3950dab9ff Add autoloader_t
autoloader_t will be the reimplementation of autoloading. Crucically it no
longer manages any locking or loading itself; instead all locking and loading
is performed by clients. This makes it easier to test and helps limit its
responsibilities.
2019-04-27 15:26:18 -07:00
ridiculousfish
b7ad6b5bdc Add autoload_file_cache_t
This will provide the "backing store" for autoloading.
2019-04-27 15:09:24 -07:00
ridiculousfish
6ec7c50ace Stop removing functions and completions in autoload
autoloading has a "feature" where functions are removed in an LRU-fashion.
But there's hardly any benefit in removing autoloaded functions. Just stop
doing it.
2019-04-27 14:49:05 -07:00
ridiculousfish
7b44b5ef15 Titlecase LRU template parameters 2019-04-27 12:07:16 -07:00
ridiculousfish
f297543ca1 Make owning_lock's template parameter titlecase instead of uppercase 2019-04-27 12:04:36 -07:00
Fabian Homborg
af0e08e9f1 argparse: Use the current function name by default
This makes the `--name` option usually unnecessary.

See #5835.
2019-04-27 15:55:49 +02:00
Fabian Homborg
eb0e0a4ab4 docs/argparse: Fix links
Fixes #5847.

[ci skip]
2019-04-27 12:16:53 +02:00
puenka
30f040ed36 Add speedtest-cli/speedtest completion (#5840)
* Add speedtest-cli/speedtest completion

Added a completion file for speedtest-cli utility (https://github.com/sivel/speedtest-cli) as shipped from various package repositories.

* added no-files parameter

* Remove inheritance to speedtest

* Create speedtest.fish
2019-04-27 09:34:28 +02:00
ridiculousfish
9bc5d60eaf Clean up enum_set.h header
Include a missing array header, and switch to idiomatic include guards.
2019-04-26 16:08:19 -07:00
Fabian Homborg
e084d097d5 docs: Remove <asis> markup
This isn't needed anymore.

[ci skip]
2019-04-26 19:25:30 +02:00
Fabian Homborg
ff62f2ae08 docs/bind: Document path-component and word
Plus fix some formatting.

[ci skip]
2019-04-26 19:23:24 +02:00
Fabian Homborg
94ece96bce CHANGELOG path-component
I should really add this immediately.

[ci skip]
2019-04-26 19:17:27 +02:00
Fabian Homborg
009ecfd7e6 src/tokenizer: Add ":@" to the list of non-path-component chars
This makes kill-path-component stop there.

Fixes #5841.
2019-04-26 19:16:21 +02:00
Fabian Homborg
ebf1914a35 CHANGELOG complete -C change
[ci skip]
2019-04-26 16:11:43 +02:00
David Gowers
38cadc9d4f Variables as commands are in fact supported, eval docs should not claim otherwise. (#5819)
Provide an example that somewhat justifies eval's existence in light of this change.

Also correct similar misinformation found in a comment.
2019-04-26 15:30:13 +02:00
Fabian Homborg
22ce8c23c6 builtin_complete: Allow complete -C something
This is a long-standing issue with how `complete --do-complete` does
its argument parsing: It takes an optional argument, so it has to be
attached to the token like `complete --do-complete=foo` or (worse)
`complete -Cfoo`.

But since `complete` doesn't take any bare arguments otherwise (it
would error with "too many arguments" if you did `complete -C foo`) we
can just take one free argument as the argument to `--do-complete`.

It's more of a command than an option anyway, since it entirely
changes what the `complete` call _does_.
2019-04-26 15:02:29 +02:00
ridiculousfish
cd86c0ee88 Remove the COMPLETE_SEP define
It was unused.
2019-04-25 14:23:37 -07:00
ridiculousfish
96bc8a14ca Promote completion_mode_t to a real type
Eliminate big #defines like NO_COMMON.
2019-04-25 14:21:06 -07:00
ridiculousfish
d962668aa0 Remove PATH and COMMAND defines
Also clean up a bit of builtin_complete
2019-04-25 13:26:43 -07:00
ridiculousfish
496529b20a Remove EXPAND prefix from expand_flags and lowercase them 2019-04-25 11:34:49 -07:00
ridiculousfish
d8ab6290e8 Switch expand_flags_t to enum_set 2019-04-25 11:23:03 -07:00
ridiculousfish
dcaac58f45 Rename expand_error_t to expand_result_t and make it class enum
Also lowercase it all.
2019-04-25 10:47:28 -07:00
ridiculousfish
b54c44f2f6 Migrate expansion stages to a new type expander_t
This avoids having to pass around so many parameters during expansion.
2019-04-25 10:47:28 -07:00
Mahmoud Al-Qudsi
ae11bf4dcb Add completions for git show $rev:$path
This command can be used to "`cat`" the contents of `$path` as of `$rev`.

These are "silent" completions, e.g. while this adds a completion for
`git show master:foo`, the completions for `git show <TAB>` are not
affected; these "advanced" completions kick in only after at least
`git show master:<TAB>` to prevent completion pollution or slowing down
tab completions in the typical case (as this would cause each valid and
possibly unique $rev completion result to complete to `n*$rev`
completions for *n* files.

[ci skip]
2019-04-23 21:54:09 -05:00
Mahmoud Al-Qudsi
4bdab33a00 Add dynamic cipher completion to ssh -c ...
[ci skip]
2019-04-22 15:17:38 -05:00
Fabian Homborg
82052a6cc9 Don't start focus reporting until later
[ci skip]
2019-04-21 20:26:57 +02:00
Fabian Homborg
b5351bce1b Bind tmux focus reporting as --preset bindings
Purely cleanup, basically.

[ci skip]
2019-04-21 19:48:46 +02:00
Aaron Gyes
51e963bf44 fixup last commit 2019-04-21 09:07:29 -07:00
Aaron Gyes
9d84b45256 __fish_print_help: remove indent
Do this lame replacement in order to make some_builtin --help
output less tacky.
2019-04-21 02:06:29 -07:00
Aaron Gyes
f309ae05b6 is_visual_escape_seq: whittle down the escape sequences attempted
Some of these we do not need to worry about actually being used
in a prompt.
2019-04-20 17:03:27 -07:00
Mahmoud Al-Qudsi
32ad1a6e62 Add basic completions for FreeBSD's camcontrol 2019-04-19 20:57:27 -05:00
ridiculousfish
fe75a3a650 Migrate autoload file checks to file_id_t 2019-04-19 18:47:07 -07:00
ridiculousfish
6dd2766a15 Remove file_access_attempt_t::stale
It was unused.
2019-04-19 18:26:29 -07:00
Wilke Schwiedop
76306c4582 completions/usermod: various fixes
* -a does not take arguments
* -e more helpful description
* -g add arguments
* -G fix arguments
* add -r to various options
2019-04-20 08:43:43 +08:00
Mahmoud Al-Qudsi
82ef2d19a5 Reduce timeout for jobs regression test
We've been moving away from full second timeouts, they were piling up.
2019-04-19 19:08:16 -05:00
Fabian Homborg
46911a5e7f Revert "__fish_describe_command: Remove awk"
Dealing with macOS output in a fast manner using `string` is surprisingly hard, given that it features lines like

    gls(1), ls(1)            - list directory contents

Printing the "gls" with the description and the "ls" with the description requires a `while read` loop, and that's too slow.

This reverts commit 7784a5f23c.

[ci skip]
2019-04-19 20:57:45 +02:00
Per Bothner
2edfab685a Some comment fixes and renaming of is_iterm2_escape_seq. (#5827)
* Some comment fixes and renaming of is_iterm2_escape_seq.

The comment for is_iterm2_escape_seq incorrectly says "CSI followed by ]".
This is wrong, because CSI is ESC followed by [ (or the seldom-used 0x9b).
The procedure  actually matches Operating System Command (OSC) escape codes.
Since there is nothing iterm2-specific about OSC, is_osc_escape_seq
would be a better name.

Also s_desired_append_char documents a non-existent parameter.

* Update broken iterm2 url in comment.
2019-04-19 09:29:35 -07:00
David Adam
4ddfd73079 add tests for #5824 2019-04-19 14:08:16 +08:00