Commit graph

2873 commits

Author SHA1 Message Date
Fabian Homborg
3bc392a6b3 functions/__fish_print_hostnames: Check getent's status
This previously effectively checked `string split ' '`s return status,
which was false if it didn't split anything. And while that should be
true if getent fails (because it should produce no output), it's also
true if it doesn't print a line with multiple aliases. Which should be
fairly typical.

Instead we use our new-found $pipestatus to check what getent returns,
in the assumption that it'll fail if it doesn't support hosts.

Follow up to 8f7a47547e.

[ci skip]
2019-06-25 08:40:31 +02:00
Fabian Homborg
8f7a47547e functions/__fish_print_hostnames: Don't run getent hosts twice
`getent hosts` is expensive-ish - ~50ms, so we don't want to run it
twice just to figure out it works.

Apparently this works everywhere but CYGWIN and possibly older
OpenBSD, but we don't want to explicitly blacklist those.

[ci skip]
2019-06-24 19:19:31 +02:00
Shun Sakai
e7b42615c8 Add FFmpeg completions (#5922)
* Add FFmpeg completions

* Fix to use builtin command
2019-06-23 16:40:26 +02:00
Lily Ballard
fe2ec1e4f8
Merge pull request #5943 from lilyball/string_collect
Add new `string` subcommand `string collect`
2019-06-22 00:30:20 -07:00
infix
ae2c40ebdb Updated DNF auto completion 2019-06-21 09:24:37 -07:00
Lily Ballard
181e44d331 Invert the flag for string collect
Instead of requiring a flag to enable newline trimming, invert it so the
flag (now `--no-trim-newlines`) disables newline trimming. This way our
default behavior matches that of sh's `"$(cmd)"`.

Also change newline trimming to trim all newlines instead of just one,
again to match sh's behavior.
2019-06-16 16:40:14 -07:00
Lily Ballard
b41e5cbbb7 Add string collect
The `string collect` subcommand behaves quite similarly in practice to
`string split0 -m 0` in that it doesn't split its output, but it also
takes an optional `--trim-newline` flag to trim a single trailing
newline off of the output.

See issue #159.
2019-06-16 15:51:57 -07:00
Fabian Homborg
b4792bde19 Remove brew completions
Leave a note in place

Fixes #5892.

[ci skip]
2019-06-12 20:42:20 +02:00
Fabian Homborg
77103ddbab Dishonour
[ci skip]
2019-06-12 10:22:46 +02:00
Fabian Homborg
c0ca4d3236 functions/history: Read the search term if none is given
Fixes #5791.
2019-06-06 15:07:46 +02:00
Shun Sakai
c566756f3b Fix long option name of zypper 2019-06-03 16:36:03 +02:00
Fabian Homborg
f9f30e6a8e completions/rsync: Fix "=THING"
This included stuff like `--max-size=SIZE`. Weird that nobody noticed?

[ci skip]
2019-05-30 21:41:58 +02:00
Fabian Homborg
cd2b1b99e8 completions/rpm: Complete files for -qf
Fixes #5127.

[ci skip]
2019-05-30 19:27:41 +02:00
Fabian Homborg
df6f3fdcf4 completions/pacman: Fix pacman -Qo
(also yaourt)

[ci skip]
2019-05-30 19:20:06 +02:00
Fabian Homborg
430b2a48a9 completions/sudo: Fix sudo -e
This uses the new "--force-files" flag.

Fixes #5646.

[ci skip]
2019-05-30 19:14:33 +02:00
Fabian Homborg
d0921489ee fish_git_prompt: Fix changing show_informative_status
If you changed $__fish_git_prompt_show_informative_status, it
triggered a variable handler, which erased the chars, but neglected to
unset $___fish_git_prompt_init, so we just kept chugging along with
empty characters.

What's the hardest thing in CS again? Cache something something?

[ci skip]
2019-05-29 10:36:14 +02:00
Fabian Homborg
6d66c47f70 completions/fish: Add FLOG additions
[ci skip]
2019-05-28 22:43:37 +02:00
Fabian Homborg
d46dacdfee Stop abusing __fish_complete_suffix to complete dirs
[ci skip]
2019-05-27 19:37:28 +02:00
Fabian Homborg
dcf017ff57 fish_complete_directories: Use complete -C
This way we use our core file completion code, which is much more
flexible than we can easily achieve directly in script (which would
require e.g. an `expand` builtin, and case-insensitive globs).

Fixes #5896.
2019-05-27 19:33:52 +02:00
Fabian Homborg
261198aa3e completions/set: Complete some config vars even if they aren't set
Fixes #5884.

[ci skip]
2019-05-21 17:00:32 +02:00
Fabian Homborg
7ddae68645 Restyle a few stragglers
THERE WERE TABS! TABS!

TABS!

[ci skip]
2019-05-20 21:07:37 +02:00
ridiculousfish
3d25ce1fd4 Merge remote-tracking branch 'takoyaki/ant_completion' into master 2019-05-11 23:22:45 -07:00
Fabian Homborg
c27c8801af completions/git: Put local branches before unique remotes
With a few remotes, unique remote branches can get quite large, and
you probably mostly work on your own.

[ci skip]
2019-05-11 12:43:05 +02:00
Fabian Homborg
816df47c10 fish_clipboard_paste: Only trim leading whitespace on first line
We remove leading spaces so a paste isn't histignored, but we did so
on all lines, which removed indentation.

[ci skip]
2019-05-11 11:19:21 +02:00
Fabian Homborg
50ed5126f1 completions/git: Reorder some completions with --keep-order
They are displayed in LIFO-order, so it makes sense to e.g. put the
recent commits close to last (only before files) for `checkout`.

Fixes #5868.
2019-05-10 15:36:41 +02:00
Fabian Homborg
cc205a134b Disable fish_title in emacs 2019-05-06 17:06:40 +02:00
Fabian Homborg
afff93bdb2 Disable vi-cursor in tests
Otherwise this breaks if run inside a terminal that could do the cursor.
2019-05-05 17:31:33 +02:00
Fabian Homborg
d83636f70e completions/git: Handle AD files
Added files that were deleted after. These count as both added and
deleted.

Fixes #5861.

[ci skip]
2019-05-05 13:49:11 +02:00
Fabian Homborg
bcce6d691f Keep "; and" and "; or" on fish files
This reformats *.fish files from before commit
c2970f9618 with the changes to fish_indent.

[ci skip]
2019-05-05 13:34:38 +02:00
Fabian Homborg
46b804cf19 fish_vi_cursor: Don't fail if --force-iterm is given in non-iterm
Otherwise this would have used it as the terminal.

Fixup!

[ci skip]
2019-05-05 13:05:19 +02:00
Fabian Homborg
e952f60b02 functions/fish_vi_cursor: Disable on iTerm, allow override
I still don't get #3696, so let's just offer an override for now.

[ci skip]
2019-05-05 13:01:02 +02:00
Fabian Homborg
7451443050 functions/fish_vi_cursor: Cleanup
Removes the unused "uses_echo" variable and adds some comments.

[ci skip]
2019-05-05 12:57:14 +02:00
Fabian Homborg
7d2eb9649c functions/fish_vi_cursor: Detect a few more terms
These have $TERM entries of their own, so detecting them is quite easy.
2019-05-05 12:57:14 +02:00
Fabian Homborg
c22af0d8c7 functions/fish_vi_cursor: Simplify detection
This was quite famously rather complicated.

We drop a bunch of cases - we can't handle tmux-starting-terminals
100% accurately, so we just don't try. It should be quite rare that
somebody starts a different terminal from tmux.

We drop the `tput` since it is useless (like terminfo in general for
feature-detection, because everyone claims to be xterm).

So we just check if we are in konsole, iTerm, vte or genuine-xterm.

Fixes #3696.

See #3481.
2019-05-05 12:57:14 +02:00
Fabian Homborg
787ef3e558 functions/fish_vi_cursor: Move $XTERM_VERSION check earlier
Saves us from having to do it again and again.
2019-05-05 12:56:31 +02:00
Fabian Homborg
ce245704d7 Reformat completion scripts
These were excluded from style.fish
2019-05-05 12:53:09 +02:00
Fabian Homborg
c2970f9618 Reformat all files
This runs build_tools/style.fish, which runs clang-format on C++, fish_indent on fish and (new) black on python.

If anything is wrong with the formatting, we should fix the tools, but automated formatting is worth it.
2019-05-05 12:09:25 +02:00
Deniz Kızılırmak
c7cbf6dad0 Make 'git checkout' complete recent commits 2019-05-05 11:52:18 +02:00
Fabian Homborg
0784b76570 completions/env: Inhibit files
(Also remove annoying "commmand" description)

[ci skip]
2019-05-03 16:35:25 +02:00
Fabian Homborg
411b4aea9d share/completions/env: Fix
This completed the commandline with options removed, which looked like

    env VAR=VAL command option

Which didn't really actually work.

Fixes #5856.

[ci skip]
2019-05-02 16:29:11 +02:00
Aaron Gyes
b5865d2cba Spruce up fish_config output, show transcript of commands run
run_fish_cmd() now prints every command we run in a subshell

Fixes #5584
2019-04-30 14:08:11 -07:00
Fabian Homborg
3b532fc793 functions/fish_vi_key_bindings: Pass "-s" to shared bindings
Fixes #5853.

[ci skip]
2019-04-30 11:41:26 +02:00
Wilke Schwiedop
95346770d3 Update emaint.fish 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
78e6631e53 formatting 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
05f79335cc completions/emerge: add verbose-conflicts 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
1b3643270d completions/epkginfo: add completion 2019-04-29 18:33:37 +02:00
Wilke Schwiedop
d0c3a4f33f completions/equery: shorten descriptions 2019-04-29 18:33:37 +02:00
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
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