Compare commits

..

435 Commits
3.2.2 ... 3.3.0

Author SHA1 Message Date
David Adam
d0593b9b2b Release 3.3.0
Closes #8012.
2021-06-28 22:46:46 +08:00
David Adam
eaa6149b87 docs: fix a missing reference 2021-06-28 22:45:29 +08:00
David Adam
0e960b77d3 CHANGELOG: minor grammar rewording 2021-06-28 22:34:35 +08:00
ridiculousfish
8ddbf85768 Correct a suspicious assigning of a value to a reference 2021-06-26 20:06:40 -07:00
Fabian Homborg
c5bcd3cc95 Document $pipestatus/not harder 2021-06-25 18:28:30 +02:00
Fabian Homborg
a3eea4325e Skip some tests on OpenBSD
sigint2 would hang (probably because of different semantics in signal
delivery?)

wcstod isn't implemented correctly, so math can't do hex numbers.

OpenBSD only passes the filename as argv[0] and doesn't give us another feature I know of, so status fish-path can't work.
2021-06-24 20:46:03 +02:00
Fabian Homborg
66bc6ce77d Try to fix tests for Solaris' ps 2021-06-24 18:19:28 +02:00
Fabian Homborg
49bac252f6 Fix some tests for OpenIndiana
Slightly different output and status - false returns 255, ls doesn't
say it's "ls" in the error.
2021-06-24 18:17:10 +02:00
David Adam
aae3a78934 CHANGELOG: final work on 3.3.0 2021-06-24 22:21:30 +08:00
Kid
85a900055d Split history commands in __fish_toggle_comment_commandline 2021-06-23 22:46:09 +02:00
Johannes Altmanninger
48c1550f61 Point to builtins begin/end when a failed command starts with "{"
Closes #6415
2021-06-23 21:47:40 +02:00
Johannes Altmanninger
565a7e4bc5 Minor refactoring to use early return in "handle_command_not_found" 2021-06-23 21:47:40 +02:00
Fabian Homborg
392e48d242 Fix fish_add_path tests
Whoopsie!

I forgot to adjust them for $PATH scope - it now prints a `-g` when
setting $PATH verbosely.
2021-06-23 21:30:10 +02:00
Johannes Altmanninger
7c2dd694e0 Provide functions to toggle commandline prefix/suffix
This introduces two functions to
- toggle a process prefix, used for adding "sudo"
- add a job suffix, used for adding "&| less"

Not sure if they are very useful; we'll see.

Closes #7905
2021-06-23 20:51:20 +02:00
Johannes Altmanninger
be0b451207 commandline: allow to get/set cursor position relative to token/process/job
With a command line like

	a | b <cursor> | c

 "commandline -C 0 --current-process" will place the cursor just left of "b".
2021-06-23 20:51:20 +02:00
Johannes Altmanninger
016569905e commandline: move handling of cursor option
No behavior change intended.
Will use the "buffer_part" computation in the next commit.
2021-06-23 20:51:20 +02:00
Johannes Altmanninger
caf1bbfc97 __fish_paginate: do not append a semicolon
I almost always use this on the last/only job in a commandline, so
the semicolon is usually not needed.  We have always added it but I
prefer not dropping it: this feels cleaner because it's what you'd
type without the shortcut.
2021-06-23 20:51:20 +02:00
Fabian Homborg
cc54917efa fish_add_path: Explicitly set $PATH as global
Fixes #8082
2021-06-23 20:01:58 +02:00
Fabian Homborg
85522036f5 docs: Undo sphinx awkwardness with code blocks
This set "clear: both", which resulted in code blocks sometimes being
pushed down a lot, resulting in weird empty space.

Just undo it, I have no idea why it's there, presumably it makes sense
with sphinx' stock theme?
2021-06-23 17:33:40 +02:00
ridiculousfish
3b4c71c546 Catch invalid function names in highlighting and autosuggestion
Prior to this change, if you were to type `./fish_indent` it woul dbe
colored as valid, because the path
`$fish_functions_path/./fish_indent.fish` is a real file. However of
course this is not actually executed as a function. Teach
function_exists to return false for function names which are invalid.
2021-06-22 12:37:45 -07:00
Wolfgang Müller
4a3df618f2 __fish_list_current_token: Do not use eval
Similarly to b0e3cc4b5 (__fish_complete_suffix: Remove `eval`,
2019-12-28), this use of eval is unsafe and can spew errors if
invoked on an incomplete brace expansion.
2021-06-22 17:44:32 +02:00
David Adam
ece88ca2d2 CHANGELOG: penultimate work on 3.3.0 2021-06-22 17:19:33 +08:00
Fabian Homborg
8787179a40 docs: Document fallback colors
A third column in the table is overkill given that we have two
exceptions.
2021-06-20 22:13:50 +02:00
Johannes Altmanninger
6c88c7d200 __fish_print_help: remove spurious bold/underline control characters
Commit d15a51897 ("Rationalize $LESS uses") switched a "less" flag
from -r (interpret all control characters)
  to -R (interpret only color codes)

Somehow this changed the output of "fish -c 'command -h'" to include
weird characters:

	DESCRIPTION^O
	command^O forces the shell to execute the program COMMANDNAME^O and ignore any functions or builtins with the same name.

Probably this was the reason why I originally used -r over -R.  Anyway,
-R is safer and it looks like we can just remove the "ul" preprocessing
since "less" will interpret bold/underline just fine.
2021-06-20 20:58:15 +02:00
Johannes Altmanninger
73b13315de completions/dd: re-use built-in file completion for "dd if=the-file"
This allows to complete file arguments even if they contain variables.

Add similar logic for arguments to Maven's -D option.

See https://github.com/fish-shell/fish-shell/issues/5248#issuecomment-857614957
2021-06-19 20:31:46 +02:00
Johannes Altmanninger
48426d6285 Tweak git completion wording (review for #8062) 2021-06-19 10:10:59 +02:00
lelgenio
b8767cc803 completions/sv.fish: create completion for sv, a part of runit. 2021-06-19 08:17:53 +02:00
Collin Styles
a5e665cd81 Add completions for "empty" options to git-commit 2021-06-18 20:49:34 +02:00
Collin Styles
feec10f389 Add completions for different types of git resets 2021-06-18 20:49:34 +02:00
Collin Styles
0abbd2bc2f Add completions for git-revert sequencer subcommands 2021-06-18 20:49:34 +02:00
Collin Styles
15fdfb5afe Add completion for --abbrev-ref option to git-rev-parse 2021-06-18 20:49:34 +02:00
Collin Styles
c9f397b968 Remove invalid completion for git-describe
The `__fish_git_unique_remote_branches` function isn't applicable here
since `git describe` won't know what to do with a remote branch without
the remote prefix. For example, if there is a branch called
`origin/my-branch`, you can't execute `git describe my-branch` until the
branch is checked out locally. In other words:

Good: `git describe origin/my-branch`
Bad:  `git describe my-branch`
Good: `git switch my-branch; git describe my-branch`
2021-06-18 20:49:34 +02:00
Collin Styles
7d5c64a731 Fix completions to cargo's --example option on macOS
The completions for the `--example` option are generated using `find`.
The `find` utility on macOS will produce the following output when the
path argument has a trailing slash:

```
~/bat $ find ./examples/
./examples/
./examples//cat.rs
./examples//advanced.rs
./examples//simple.rs
./examples//list_syntaxes_and_themes.rs
./examples//yaml.rs
```

And will produce this output if the path does NOT have a trailing slash:

```
~/bat $ find ./examples
./examples
./examples/cat.rs
./examples/advanced.rs
./examples/simple.rs
./examples/list_syntaxes_and_themes.rs
./examples/yaml.rs
```

The extra slash after `examples` ends up in the completion suggestions
which is incorrect:

```
~/bat $ cargo run --example <TAB>
/advanced  /cat  /list_syntaxes_and_themes  /simple  /yaml
```

Unlike on my Linux box where `find` doesn't output the trailing slash:

```
~/bat $ cargo run --example <TAB>
advanced  cat  inputs  list_syntaxes_and_themes  simple  yaml
```

Importantly, I get the same (correct) output on Linux even without the
trailing slash in the path argument to `find`.
2021-06-15 21:22:44 +08:00
Johannes Altmanninger
701b7450df __fish_is_first_arg: only look at current process
This fixes the completions in

	btrfs command | btrfs <TAB>

See #8060
2021-06-15 03:38:52 +02:00
Johannes Altmanninger
f0de75ddd9 completions/git: complete normal files on "git restore -sHEAD "
A full "git ls-files" is slow on larger repositories; this makes the
common case (desired path exists on file system) faster.
2021-06-15 03:27:55 +02:00
Johannes Altmanninger
585dc16a66 completions/git: complete normal files on "git checkout -- "
This can give false positives but only if used on directories that
mix tracked and untracked files. The performance is better than
listing all tracked files, and in any case we're pretty far from a
correct solution that knows the target Git commit, so this seems like
good compromise.
2021-06-15 03:27:55 +02:00
Johannes Altmanninger
2bc8057780 Remove redundant parens 2021-06-15 03:27:55 +02:00
Johannes Altmanninger
4908f9bb40 Remove spurious character escape 2021-06-15 01:19:01 +02:00
ridiculousfish
1c20bdcbf9 Minor improvements to file_id_t 2021-06-13 17:20:04 -07:00
ridiculousfish
ba2e7db7e8 Notice when exit has been run from within fish_prompt
This allows `exit` to tell the reader to stop, when run inside
fish_prompt. Fixes #8033.
2021-06-12 10:20:49 -07:00
Fabian Homborg
9e46d49dd9 webconfig: Remove tab top border in dark mode 2021-06-10 21:26:03 +02:00
Fabian Homborg
e571902a85 webconfig: Hover more things
The buttons were already supposed to highlight on hover, but the color
difference was barely visible. Crank that up.

Also add a hover color to the tabs, colorschemes, prompts, functions.

The big clickable things.
2021-06-10 21:25:40 +02:00
Fabian Homborg
f6a6537f7b css: Some minor adjustments
Make borders less bright in dark version, add some padding to the body.
2021-06-10 21:00:18 +02:00
Fabian Homborg
f073bf59a8 CHANGELOG for 3.3 2021-06-10 16:49:28 +02:00
Fabian Homborg
7059eaa4ab Revert "Disallow escaped characters in variable expansion"
This reverts commit 555af37616.
2021-06-10 16:46:17 +02:00
Fabian Homborg
d2b210ee15 docs: Mention all set_color modifiers
This spoke of "--bold" and "-b", which are two different things - "-b"
is short for "--background", bold is "-o".

Instead let's just mention the long versions of all the switches.

See #8053.
2021-06-10 10:50:51 +02:00
Fabian Homborg
95103893e6 output: Allow "--background foo" and "-b foo" for background colors
This only accepted "--background=". Really what we need to do is do an
actual getopt, but that wants a null-terminated array and is tightly
coupled to set_color.

Fixes #8053.
2021-06-10 10:42:30 +02:00
Fabian Homborg
695027234b completions/git: Complete untracked files immediately
Fixes #8049
2021-06-08 08:53:49 +02:00
Fabian Homborg
71b9463165 docs: Some tweaks to "Syntax overview" 2021-06-06 21:36:04 +02:00
Fabian Homborg
b0b8cb0129 docs: Move color variables to interactive
A bunch of our variables are only relevant for interactive use, but
this is two whole sections on them. Simply move them inside "Syntax
highlighting" and leave the link in Special Variables.
2021-06-06 17:43:06 +02:00
David Adam
f90577ddf6 CHANGELOG: work on 3.3.0 2021-06-06 23:24:31 +08:00
Fabian Homborg
a9b4ad4b9f README: Document build options 2021-06-06 12:21:44 +02:00
David Adam
7aefaff298 CMake/CheckIncludeFiles: use correct variable name
Merged from https://gitlab.kitware.com/cmake/cmake/-/merge_requests/1538

This file can be dropped once the minimum version of CMake for fish is
3.11.0.
2021-06-06 18:10:03 +08:00
Fabian Homborg
775c5f01b4 CHANGELOG locale coercion 2021-06-06 09:31:40 +02:00
Fabian Homborg
046db09f90 Try to set LC_CTYPE to something UTF-8 capable (#8031)
* Try to set LC_CTYPE to something UTF-8 capable

When fish is started with LC_CTYPE=C (even just effectively, often via
LC_ALL=C!), it's basically broken. There's no way to handle non-ASCII
characters with a C locale unless we want to write our
locale-independent replacements for all of the system functions.

Since we're not going to do that, let's try to find *some locale* for
LC_CTYPE.

We already do that in __fish_setlocale, but that's

- a bit of a weird thing that reads unstandardized system
  configuration files
- allows setting locale to C explicitly

So it's still easily possible to end up in a broken configuration.

Now, the issue with this is that there is (AFAICT) no portable way to
get a list of all allowed locales and C.UTF-8 is not standardized, so
we have no one locale to fall back on and are forced to try a few. The
list we have here is quite arbitrary, but it's a start.

Python does something similar and only tries C.UTF-8, C.utf8 and
"UTF-8".

Once C.UTF-8 is (hopefully) standardized, that will just start
working (tm).

Note that we do not *export* the fixed LC_CTYPE variable, so external
programs still have to deal with the C locale, but we have no real
business messing with the user's environment.

To turn it off: $fish_allow_singlebyte_locale, if set to something true (like "1"),
will re-run the locale initialization and skip the bit where we force
LC_CTYPE to be utf8-capable.

This is mainly used in our tests, but might also be useful if people
are trying to do something weird.
2021-06-06 09:28:32 +02:00
Fabian Homborg
e57c998d4c webconfig: Make a bit nicer on smaller screens
Actually remove the margins, distribute the color choices evenly and
switch to small mode a bit earlier.
2021-06-05 11:46:23 +02:00
Fabian Homborg
48acd316c8 CHANGELOG
Document the last few changes and move some of the things out of
"Interactive" into more specific categories. If it's to do with
completions, it goes into completions. Bindings? How about "Bindings"?
2021-06-05 11:32:22 +02:00
Fabian Homborg
7a5e192607 Make background a bit more blue, brighter 2021-06-05 11:17:53 +02:00
Fabian Homborg
c2b35d3171 Adjust colors a teensy bit
Make a bit less ultra-dark blue
2021-06-05 11:17:53 +02:00
Fabian Homborg
64bbc8b304 webconfig: Dark mode 2021-06-05 11:17:53 +02:00
Fabian Homborg
606a8a7a1a Darkmode for docs
This uses the prefers-color-scheme media query to pick between dark and light mode,
so the user automatically gets the colorscheme they prefer.
2021-06-05 11:17:53 +02:00
Fabian Homborg
155160e49b Msys also has a weird kill
Like Cygwin, it doesn't feature an option to list the signals, so we
simply hardcode them.

Fixes #8046.
2021-06-05 11:15:53 +02:00
Fabian Homborg
1fc6f77378 docs: Make toctree more spread out
Easier to tap on a phone
2021-06-03 20:55:36 +02:00
Fabian Homborg
a17f7468b7 docs: Make sidebar more readable
and tappable - more line-height, larger fonts in narrow mode.

In turn the search box really doesn't need that massive margin above.
2021-06-03 20:55:36 +02:00
Fabian Homborg
44a6795ead webconfig: Set image height explicitly
Chrome says that's better, presumably because it can then tell how
large the image is before it's loaded. Not that this tiny image really
is a massive problem, but let's be good, not acceptable.
2021-06-03 20:55:36 +02:00
Fabian Homborg
5f4dfd9951 webconfig: Remove weird position: absolute
This made the current prompt appear directly under the tab,
disregarding the padding.

That means it looked inconsistent with the colors. (note there's still
less padding on the side, but at least that allows more actual content
- prompts are often fairly wide)
2021-06-03 20:55:36 +02:00
Fabian Homborg
46208ff276 CHANGELOG 2021-06-03 10:07:54 +02:00
Fabian Homborg
4e718506e3 Vi-bindings: Use fish_clipboard_copy
This has one slight behavioral change: Even with xsel, it now copies
to the clipboard, not the primary. I would imagine anyone who cares
about the primary selection has customized fish_clipboard_copy and
because we never got a bug about this not supporting anything but
xsel (and errorring out if it's not available!) this is probably
unused.

So now we support all the clipboard integration things, and we use the clipboard.
2021-06-03 10:04:30 +02:00
Fabian Homborg
c18c7a4ce4 Document vi-visual mode keys 2021-06-03 10:03:43 +02:00
mtoohey31
6ca9f9ee38 fish_vi_key_bindings: bind s to follow vim visual behaviour
This change adds a binding that sets the s key's behaviour to match
the c key's in visual mode. This mirrors vim's behaviour (see `:h v_s`
in vim or neovim).
2021-06-03 09:57:22 +02:00
Fabian Homborg
a633889244 ls: Ignore ruby colorls
Apart from OpenBSD's "colorls" that is basically an ls that can do
color, there's also a ruby tool called "colorls" that's closer to exa.

Ignore that one since the options it understands are quite different
and I'm betting it's slower (given my experience with ruby tools).

See #8042.
2021-06-03 09:54:20 +02:00
Fabian Homborg
344bd63e0b webconfig: Remove unneeded inline style
This makes changing it harder and is unnecessary
2021-06-02 17:57:48 +02:00
Fabian Homborg
850419d127 docs: Style footnote-references like footnotes
Emphasizes that they belong together
2021-06-02 17:48:16 +02:00
Fabian Homborg
1fed36d005 docs: Deduplicate some styles 2021-06-02 17:47:07 +02:00
Fabian Homborg
843c9383aa docs: Remove non-functional link 2021-06-02 17:33:55 +02:00
Fabian Homborg
bc00188ca8 docs: Make footnotes stand out a teensy bit 2021-06-02 17:12:45 +02:00
Fabian Homborg
553ce7a006 docs: Inherit some more background colors
Unfortunately sphinx hardcodes these again in classic.css, and if we
want to change them we need to make these the same again.
2021-06-02 17:12:45 +02:00
Fabian Homborg
884768dded docs: Make some background-colors dependent
This is so we can more easily change the background.
2021-06-02 17:12:45 +02:00
David Adam
8e51123574 CHANGELOG: work on 3.3.0 2021-06-02 22:37:48 +08:00
Scott Bonds
ad38730792 ignore __fish_ls_color_opt when using colorls 2021-06-01 20:10:04 +02:00
Scott Bonds
3ddb5a2bdc Add color to ls output on OpenBSD when colorls is installed (#8035)
* add support for colorized ls on openbsd

* add changelog line for colorls support

* add readme line for colorls support

* determine ls command at runtime, don't cache it

* eliminate __fish_ls_command function
2021-06-01 19:46:13 +02:00
David Adam
83a11dda3f CHANGELOG: work on 3.3.0 2021-06-01 23:00:47 +08:00
ridiculousfish
c5ec4ef5f9 Reverts noshebang test fixes
The hope is that the noshebang test was fixed on old glibc
through e74b9d53df. Revert the previous optimistic attempts to
fix these through adding sleeps and subshells.

This reverts commit b3da0bd5a2.
This reverts commit 8a86d3452f.
2021-05-31 13:42:26 -07:00
ridiculousfish
e74b9d53df Do not use posix_spawn on glibc < 2.24
This concerns the behavior of posix_spawn for shebangless scripts. At some
point, glibc started executing them using `sh`, which is desirable for
fish's shebangless support (see #7802). On glibcs without that behavior
the shebangless test fails. So this change disables posix_spawn on older
glibcs.

It's not easy to figure out when that happened but it definitely happens
in glibc 2.28, and does not happen in glibc 2.17. Presumably the new
behavior is present in glibc 2.24 (see BZ#23264) so that's the cutoff:
posix_spawn is no longer allowed on glibc < 2.24.

This fixes the noshebang test failures on Ubuntu Xenial and Centos 7.
See discussion at bottom of #8021.
2021-05-31 13:38:56 -07:00
ridiculousfish
50c851d10e Clean up use_posix_spawn
Switch from a global variable to a real function. Make the value atomic.
Clean up handle_fish_use_posix_spawn_change().
2021-05-31 13:38:56 -07:00
ridiculousfish
50e63d4c04 Add centos8 and Ubuntu Xenial dockerfiles 2021-05-31 13:38:56 -07:00
Fabian Homborg
b3da0bd5a2 tests/noshebang: Add some longer sleeps
This still fails on launchpad. Last try, then I'm removing this - it's
not really expected that this particular bit would change a lot.
2021-05-30 17:19:04 +02:00
Fabian Homborg
8a86d3452f tests/noshebang: Do redirections in a new shell process
This is an attempt to solve the test failures on Launchpad's CI.

I'm assuming when we do a redirection like

    foo > file

and then try to execute `file` immediately afterwards, we either
haven't written it soon enough or closed the file, so we get a "text
file busy" error.

So, when we do that in a new fish the file should be closed once it
quits.

See #8021.
2021-05-30 11:08:33 +02:00
Fabian Homborg
eed2173860 docs: Stop including main css in pygments.css
This led to pydoctheme.css being included *twice*, which led to
everything it included being included twice, which was annoying in
firefox when playing with the styles.

I don't *think* it had any performance impact?
2021-05-28 20:49:57 +02:00
Fabian Homborg
470258ffd1 docs: Some rewording to the tutorial
Add a link to fish-for-bash-users, mention string collect, some reformatting
2021-05-28 20:49:57 +02:00
Fabian Homborg
21f5032a55 docs: Don't speak of "initialization files"
The file is called "config.fish", not "init.fish". We'll call it
"configuration" now.

"Initialization" might be slightly more precise, but in an irritating
way.

Also some wording improvements to the section. In particular we now
mention config.fish *early*, before the whole shebang.
2021-05-28 20:49:57 +02:00
gurudarshan266
b5d48acd7c Condensed descriptions for various commands (#8034)
* Shorten descriptions for tmux.fish

* Shorten descriptions for bundle.fish

* Fix description in dhclient.fish
2021-05-28 18:50:01 +02:00
Fabian Homborg
cfc8d14a8d docs: Force sections to be full-width
Otherwise there's this weird *gap*, where the sections are narrow even
tho there's plenty of space?

So you have this screen layout:

```table
| sidebar | text        |
| sidebar | narr        |
| sidebar | ower        |
| sidebar | than        |
| sidebar | need        |
| sidebar | ed          |
```

For some gosh-forsaken reason.
2021-05-27 22:40:04 +02:00
Fabian Homborg
21cb791557 docs: Let the sidebar move
This means the nice navigation to other chapters always stays on
screen, instead of scrolling away.
2021-05-27 22:17:30 +02:00
Fabian Homborg
0e771590e6 docs: Remove stray mention of the IRC channel
This was apparently missed in 1f976a5041.
2021-05-27 21:41:52 +02:00
Fabian Homborg
671d820277 set_color: Print an error for unknown options
This was forgotten, so e.g. calling `set_color --bg foo` results in
nothing being printed, which might result in strings being removed - #5443.
2021-05-27 19:03:55 +02:00
Fabian Homborg
7511de8d8d tests/noshebang: Sleep before executing a file we just wrote to
When you try to execute a file directly after you've written to it,
you might, on some systems, get a "text file busy" error.

So we unfortunately have to sleep to avoid it.

See #8021 for where this was added,
537b3f6cb1 for the same problem.
2021-05-26 17:14:15 +02:00
exploide
34ededa644 updated hashcat completions to version 6.2.1 2021-05-26 13:04:36 +02:00
ridiculousfish
9820307d23 Move builtin_bind to out-of-line
There was no point in inlining this code.
2021-05-25 17:39:55 -07:00
ridiculousfish
73998b81b4 Correct the docs for commandline --current-buffer
commandline current-buffer was incorrectly documented as returning the
autosuggestion. Clarify that it does not.
2021-05-25 17:15:42 -07:00
ridiculousfish
08950b1077 Revert "Bravely set job control to full at startup"
Now that `$last_pid` is never fish's pid, we no longer need to force
jobs to run in their own pgroup. Restore the job control behavior to
what it was prior, so that signals may be delivered properly in
non-interactive mode.

This reverts commit 3255999794
2021-05-25 15:28:53 -07:00
ridiculousfish
33f3c03dae Allow on-job-exit handlers to be added for any pid in the job
Prior to this change, a function with an on-job-exit event handler must be
added with the pgid of the job. But sometimes the pgid of the job is fish
itself (if job control is disabled) and the previous commit made last_pid
an actual pid from the job, instead of its pgroup.

Switch on-job-exit to accept any pid from the job (except fish itself).
This allows it to be used directly with $last_pid, except that it now
works if job control is off. This is implemented by "resolving" the pid to
the internal job id at the point the event handler is added.

Also switch to passing the last pid of the job, rather than its pgroup.
This aligns better with $last_pid.
2021-05-25 15:28:53 -07:00
ridiculousfish
f3d78e21d1 Switch last_pid from the pgroup to the actual last pid
When a job is placed in the background, fish will set the `$last_pid`
variable. Prior to this change, `$last_pid` was set to the process group
leader of the job. However this caussed problems when the job ran in
fish's process group, because then fish itself would be the process group
leader and commands like `wait` would not work.

Switch `$last_pid` to be the actual last pid of the pipeline. This brings
it in line with the `$!` variable from zsh and bash.

This is technically a breaking change, but it is unlikely to cause
problems, because `$last_pid` was already rather broken.

Fixes #5036
Fixes #5832
Fixes #7721
2021-05-25 15:28:53 -07:00
David Dorfman
f2448e3f0e env: remove trailing null-terminator from default path 2021-05-25 08:12:21 +02:00
Fabian Homborg
2b0b0fe042 tests/bind: Skip on Github macOS
This just fails too much to be of any use.
2021-05-23 19:46:04 +02:00
ridiculousfish
35f77a5473 Switch locale_variables and curses_variables from vector to array
No reason to have these be a heap-allocated vector.
2021-05-22 12:50:26 -07:00
Fabian Homborg
fe4eaba563 Fix set_cloexec check
Fixes #8023.
2021-05-22 18:09:15 +02:00
Fabian Homborg
e81b3e06c5 docs: Add a section on subshells to fish-for-bash-users 2021-05-22 17:30:45 +02:00
ridiculousfish
9d696ba7d2 Remove some assignments of wcs2string to references
wcs2string returns a std::string by value; it should not be assigned to a
reference variable.
2021-05-21 13:11:56 -07:00
ridiculousfish
9928404920 Remove some static_asserts out of the common.h header
These asserts require a recursive template instantiation and are currently
checked for every file that pulls in common.h. Place them in a .cpp file so
they are only checked once, hopefully improving compile time.
2021-05-21 13:06:43 -07:00
ridiculousfish
7123e2f25d Remove another errant negation 2021-05-20 11:10:09 -07:00
ridiculousfish
fac8f14e07 Correct a negated pgid
When printing the description of an event, there was an errant negation
from when fish stored the pgid negated. Remove it.
2021-05-20 11:07:36 -07:00
ridiculousfish
504a969a24 Separate on-job-exit and and on-process-exit events
It is possible to run a function when a process exits via `function
--on-process-exit`, or when a job exits via `function --on-job-exits`.
Internally these were distinguished by the pid in the event: if it was
positive, then it was a process exit. If negative, it represents a pgid
and is a job exit. If zero, it fires for both jobs and processes, which is
pretty weird.

Switch to tracking these explicitly. Separate out the --on-process-exit
and --on-job-exit event types into separate types. Stop negating pgids as
well.
2021-05-19 11:29:08 -07:00
Fabian Homborg
406bc6a5d6 docs: Remove obsolete part from functions
This was forgotten in #5951, which allowed `functions --erase` to
prevent functions from being autoloaded.

Fixes #8014
2021-05-19 19:09:46 +02:00
Fabian Homborg
3a0faa4dfd CHANGELOG rewording 2021-05-19 08:41:14 +02:00
Fabian Homborg
d5a30ed103 docs: Split off links to other pages into its own section
This is an attempt to make these more visible - the intro section
explains what this is, and then we mention where to go, and after that
we go into installation and stuff.

I don't think putting "where to go" *after* the installation
instruction is correct, but maybe it is? For the time being, we keep
the order as it is.
2021-05-18 22:53:13 +02:00
Jyry Hjelt
08a455d4f1 Fixed a typo in rc-update autocompletion 2021-05-18 13:55:27 +02:00
Fabian Homborg
0991e0b27f docs: Mention cursor in the wrong position for unicode FAQ
This is now more likely than the staircase thing since
0660ea5be758a25cbfd5703055af122842c10cb0..25595a94c72c8fd1385bfa66b5efecd26839488b.
2021-05-18 13:18:35 +02:00
Fabian Homborg
a09125897e Tests: Set $XDG_DATA_DIRS to empty instead of unsetting
NetBSD's `env` doesn't have `-u` and this should be harmless.
2021-05-18 12:24:24 +02:00
Fabian Homborg
63dd046f99 screen: Remove errant line
This was an experiment that was accidentally committed. Sorry!
2021-05-18 11:27:30 +02:00
Fabian Homborg
5743a536b0 proc: Include sys/wait.h
Might fix build on FreeBSD.
2021-05-18 10:18:50 +02:00
Fabian Homborg
68bd3988d4 builds/FreeBSD: Move to py38-pexpect
Encoding the version like this is annoying and I would wish for
FreeBSD to either stop or provide a "python-pexpect" metapackage that
just pulls in whatever the current version is.
2021-05-18 10:09:13 +02:00
Fabian Homborg
c19a6e912d Readd awkward unused-result dance
This was removed in 962b0f8b90,
presumably with the idea that casting to void, like before, was
enough.

It's not, at least with gcc 11.1
2021-05-18 09:44:29 +02:00
Fabian Homborg
e19ccc8a7a CHANGELOG
Ye olde change logge.
2021-05-18 09:22:40 +02:00
Fabian Homborg
4b2bce7b83 screen: Remove useless .c_str() and wcslen calls
This passed the wchar_t* to outputter::writestr(), which then had to
do a wcslen on it, when it already has a perfectly cromulent
wcstring overload.

Just use that one.
2021-05-18 09:11:56 +02:00
Fabian Homborg
25595a94c7 screen: Also move cursor after printing the prompt
This helps with width issues when no right prompt is used.
2021-05-18 09:09:59 +02:00
Fabian Homborg
0660ea5be7 Move the cursor to the beginning before printing right prompt
This makes the right prompt position independent of the width of the
commandline, which prevents staircase effects. That means, with "X"
standing in as a character that the terminal and fish disagree on:

```
> echo X           rightprompt
```

will stay like that instead of creating a staircase like

```
> echo X            rightpromp
t> echo X             rightpromp
pt> echo X
```

and so on.

The cursor still won't be *correct*, but it will be wrong in a less
annoying way.
2021-05-18 09:09:59 +02:00
ridiculousfish
d3ceba107e Clear to eol before outputting line in multi-line prompt
If the user has a multi-line prompt, we will emit a clr_eol on every
line except the last (see #7404). Prior to this change we would emit
clr_eol after the line, but in some terminals, if the line extended the
width of the tty, the last character would be deleted. Switch to
emitting clr_eol first; now the last character will not be cut off.

Fixes #8002
2021-05-17 21:44:17 -07:00
ridiculousfish
c0b33774ca Update docs on detecting fish_private_mode
fish_private_mode is active if set to something non-empty, but the docs
suggested checking if it is set at all. Switch the docs to match the
implementation through `test -n "$fish_private_mode"`

Fixes #8001
2021-05-17 18:42:52 -07:00
ridiculousfish
6d00ad1045 Ensure that on-process-exit events fire for reaped jobs
This ensures that if a job exits before we have set up the
on-process-exit handler, the handler will still fire.

Fixes #7210
2021-05-17 15:28:32 -07:00
ridiculousfish
60d75e9aa0 Remove proc_create_event
Switch to a set of factory functions inside event_t.
No user-visible change here.
2021-05-17 15:26:59 -07:00
ridiculousfish
962b0f8b90 Pass $status to process-exit event handlers in all cases
Previously, an event handler would receive -1 if the process exited due
to a signal. Instead pass the same value as $status.
2021-05-17 15:25:27 -07:00
ridiculousfish
82fd8fe9fb Refactor wait handles
In preparation for using wait handles in --on-process-exit events, factor
wait handles into their own wait handle store. Also switch them to
per-process instead of per-job, which is a simplification.
2021-05-17 15:25:21 -07:00
Fabian Homborg
b63b511b0a docs: Clarify when on-variable handlers will be run
Fixes #8010.
2021-05-17 17:20:36 +02:00
Fabian Homborg
a427bf207a reader: Fix crash when text is empty after stripping spaces
This crashed on Fedora with the rpm packages, but not when building
from source, so some compiler option triggers it.

But the root cause is us running `text.front()` on an empty string,
which isn't something you should do.

Fixes #8009.
2021-05-16 22:16:22 +02:00
Karolina Gontarek
31f3c16857 Resolve relative paths in command names for complete -p
Fixes #6001
2021-05-16 21:52:38 +02:00
Fabian Homborg
c38f4980f9 docs: Some tweaks on initialization 2021-05-16 21:27:00 +02:00
Fabian Homborg
af84c35282 docs: A bit more on autoloading 2021-05-16 21:27:00 +02:00
Johannes Altmanninger
e10cab8104 Tweak documentation wording to include non-option arguments 2021-05-16 20:48:53 +02:00
Kid
e714ce238e Add missing options for complete 2021-05-16 17:33:49 +08:00
ridiculousfish
63ee28c1de Fix a misleading comment 2021-05-15 22:05:35 -07:00
ridiculousfish
5de63c9cbb Reimplement builtin_wait using wait handles
This switches builtin_wait from waiting on jobs in the active job list, to
waiting on the wait handles. The wait handles may be either derived from
the job list itself, or from saved wait handles from jobs that exited in
the background.

Fixes #7210
2021-05-15 21:48:15 -07:00
ridiculousfish
632e150152 Introduce notion of "wait handles"
This is preparing to address the problem where fish cannot wait on a
reaped job, because it only looks at the active job list. Introduce the
idea of a "wait handle," which is a thing that `wait` can use to check if
a job is finished. A job may produce its wait handle on demand, and
parser_t will save the wait handle from wait-able jobs at the point they
are reaped.

This change merely introduces the idea; the next change makes builtin_wait
start using it.
2021-05-15 20:20:50 -07:00
Fabian Homborg
d15a51897d Rationalize $LESS uses
Stop using "--no-init"/"-X" because we have no actual reason to and it
may break mouse initialization on my best friend macOS.

Use --RAW-CONTROL-CHARS, the capital version that only lets through
specific escape sequences, not *everything* - we shouldn't have
anything weird here, but less heavily discourages the other version.

Allow a user's $LESS to override.

Fixes #7997.
2021-05-14 22:18:59 +02:00
Fabian Homborg
2cfb4343ed man: Remove useless dirname call
This removed "/fish" just to add it back.
2021-05-14 21:49:53 +02:00
Érico Nogueira
3ac2242c68 completions: fix pacmd completions when using pipewire-pulse.
In such cases, `pacmd help` prints

  No PulseAudio daemon running, or not running as session daemon.

to stderr, which ends up printed to the user terminal.
2021-05-14 21:19:06 +02:00
ridiculousfish
aeabc76b2e Use internal job ids in builtin_wait
This avoids any potential issues due to recycled job IDs.
No user visible change.
2021-05-13 12:11:00 -07:00
ridiculousfish
6bae9ebe62 Add an Alpine Dockerfile build
This may be run with:

    ./docker/docker_run_tests.sh ./docker/alpine.Dockerfile
2021-05-13 11:00:05 -07:00
Fabian Homborg
240fb9fd45 docs: Unbreak sphinx' man directories
Apparently new sphinxen want to create an *additional* section
directory, so things end up in /usr/share/fish/man/man1/1, instead of /usr/share/fish/man/man1

Why? No idea.

I can't reproduce it but I'm told this section fixes it.

Fixes #7996
2021-05-13 18:20:47 +02:00
Fabian Homborg
678fa2e6a9 docs: A bit on index ranges
Try to make list-ness more accessible.
2021-05-12 19:40:43 +02:00
Fabian Homborg
127eaded96 docs: Mention set in variable expansion
This isn't strictly speaking variable expansion, but it's so related
that we should at least tease it.

See #7990.
2021-05-12 19:28:34 +02:00
Fabian Homborg
9fd69acd1a docs: Clean up set a bit
More links! Links good! Link link linky link!
2021-05-12 18:52:24 +02:00
Fabian Homborg
dbc6bffe3c __fish_set_locale: Ignore $LANGUAGE
This isn't really a "locale" variable as such. It has no effect on
encoding and stuff, it's just the output language.

What we really want here is get something better than the awkward "C"
or "POSIX" for LC_CTYPE specifically - everything else doesn't really
matter.
2021-05-11 21:53:58 +02:00
ridiculousfish
786b0463b6 Fix a unique_ptr build error with gcc 4.8 2021-05-10 16:49:11 -07:00
ridiculousfish
04535e9701 Fix a few mild warnings with gcc 4.8 2021-05-10 16:49:01 -07:00
ridiculousfish
91a4059a8f Changelog fix for #7968 2021-05-10 16:03:33 -07:00
ridiculousfish
71df8f8622 Do not flock the uvars file on remote filesystems
In rare cases this may cause the universal variable file to drop
an update, if two happen at the same time and HOME is on an nfs mount.
But this is considered better than hanging if nfs is lockless.

Fixes #7968.
2021-05-10 15:24:32 -07:00
ridiculousfish
ba33b6dcc8 Mild refactoring of flock logic inside env_universal_t
This reorganizes the flock code in env_universal_t, removing a static
variable and making the behavior more explicit.
2021-05-10 15:23:57 -07:00
ridiculousfish
083f2698f9 Remove internal lock from env_universal_t
env_universal_t locking discipline is now managed by env.cpp.
That is, the shared instance of env_universal_t is managed by a lock.
We no longer need to have an internal lock, so remove it.
2021-05-10 15:23:57 -07:00
ridiculousfish
8d06357fbb Take advantage of empty uvars
Now that we allow uvars to be empty and uninitialized, we can always
instantiate it; we don't need to test whether it is null or not.
2021-05-10 15:23:56 -07:00
ridiculousfish
e2a1b25a24 Continue refactoring env_universal_t
Previously an instance of env_universal_t had to be created with a file
path. Switch to allowing it to be created as empty, and later initialized
with the file path. This will help simplify the case where universal
variables are not used; they may simply be not initialized and so just
appear empty.
2021-05-10 15:23:08 -07:00
ridiculousfish
16ba45fe64 Early work towards changing locking discipline of uvars
Rather than universal variables holding their own lock, we will wrap the
instance in a lock.
2021-05-10 14:23:07 -07:00
ridiculousfish
fa7402c415 Reorganize env_universal_t so that the public bits are at the top
No functional change here.
2021-05-10 14:23:07 -07:00
ridiculousfish
0d8cb0125a Remove the narrow_vars_path from universal variables
This was a cache of the wide vars_path, but it's not worth its
complexity.
2021-05-10 14:23:07 -07:00
ridiculousfish
6ab7945623 Mild refactoring of universal variables
This removes some unnecessary returns and other miscellaneous cleanup.
2021-05-10 14:23:07 -07:00
ridiculousfish
c8d909b2b2 Remove fd_check_is_remote
This function is no longer used; instead we detect if a given path is
remote, once, typically at startup.
2021-05-10 14:23:07 -07:00
ridiculousfish
1af441b4cc Do not lock the history file on remote filesystems
This avoids using locks for the history file if the file appears to be on
a remote file system, like NFS. This is to avoid hangs if the filesystem
does not support locking.

If locking is not enabled, then in rare cases, history items may be
dropped if multiple sessions try to write to the history file at once.
This is thought to be better than hanging. Hopefully the recent change to
require a trailing newline will avoid propagating partial items.
2021-05-10 14:23:07 -07:00
ridiculousfish
d1fd3d5825 Detect at startup whether config and data paths are remote
This is in preparation for changing the locking regime of history.
2021-05-10 14:23:07 -07:00
ridiculousfish
541e1d2fad base_directory_t to stop storing explicit success bool
This can be trivially computed from the error code.
2021-05-10 14:23:07 -07:00
ridiculousfish
f85f6a0127 Enforce that history items must end with trailing newlines
This helps prevent seeing partially written items from other sessions,
in preparation to reducing the amount of flocking done.
2021-05-10 14:23:07 -07:00
ripytide
8c19b6105f Not quite accurate code example heading 2021-05-10 19:28:06 +02:00
ripytide
40704ba7a2 Explanation of list range example wrong way round.
I'm assuming the first number before the **..** is the FROM and the number after it is the TO.
2021-05-10 17:01:12 +02:00
ridiculousfish
aa02cbd090 Wrap up history's mmap logic into its own type
This improves the factoring a bit.
2021-05-09 11:59:29 -07:00
ridiculousfish
d1befee19e Fix some potential leaks in history file contents
If history is corrupt and cannot be read, fish would return an error
without munmaping the file. Ensure it is properly munmapped.
2021-05-09 11:59:29 -07:00
ridiculousfish
c1f97c20b5 Pull in missing headers for MNT_LOCAL
fstatfs was only being used on Linux because MNT_LOCAL was not defined.
Pull in sys/mount.h and sys/param.h so macOS can see MNT_LOCAL.
2021-05-09 11:59:29 -07:00
ridiculousfish
37356fed44 Use wide printing when outputting debug categories
glibc doesn't like it when wide and narrow printing is mixed.
This fixes a strange beeping when running with debug enabled on glibc.
2021-05-09 11:59:29 -07:00
Fabian Homborg
aa84a4ba30 docs: Links for the function-related commands 2021-05-08 12:12:56 +02:00
ridiculousfish
555af37616 Disallow escaped characters in variable expansion
Prior to this fix, an escaped character like \x41 (hex for ascii A)
was interpreted the same was as A, so that $\x41 would be the same
as $A. Fix this by inserting an INTERNAL_SEPARATOR before these escapes,
so that we no longer treat it as part of the variable name.

This also affects brackets; don't treat echo $foo\1331\135 the same as
echo $foo[1].

Fixes #7969
2021-05-05 16:23:06 -07:00
ridiculousfish
3f35012afb Fix openssl completions for LibreSSL
Fixes #7966
2021-05-05 14:42:36 -07:00
ridiculousfish
f25b9f9831 Make the webconfig HTTP server threaded, fixing a Safari hang
Recently Safari seems to hang with fish webconfig. This is apparently
because Safari is opening a socket and not writing to it, causing
webconfig to hang until the timeout (30 seconds). It's not clear why.

Use ThreadingMixIn so that FishConfigTCPServer can handle more
than one connection at a time. This fixes the hang under Safari.
2021-05-05 13:29:55 -07:00
Johannes Altmanninger
fa74dc977b fish_greeting: show private mode message if $fish_greeting is empty list
This was droped because of Cartesian product expansion.
Also fix the spurious dot in case the greeting is "".

Fixes #7974
2021-05-05 18:53:51 +02:00
Cycatz
889ff25c75 Remove extra chars after -p and --load options 2021-05-05 21:45:16 +08:00
ridiculousfish
d338c45205 Fix a Sphinx warning
Add a newline to fix "Literal block ends without a blank line."
2021-05-04 13:50:09 -07:00
ridiculousfish
b823b91bcd Remove an errant newline from the dirs function
The dirs function prints an extra newline; it is not obvious why this is
needed but it has been this way forever. Let's remove it.
2021-05-04 13:32:21 -07:00
ridiculousfish
f0f10618df Improve the documentation for pushd
Correct the examples so that the directory stack is correct.
Fixes #7940
2021-05-04 13:21:46 -07:00
ridiculousfish
e0bf23ad26 Refactor the named pipe uvar notifier with a state machine
This attempts to simplify the named pipe notifier by switching to a state
machine model.
2021-05-04 11:59:12 -07:00
ridiculousfish
7c5b8b8556 Use the uvar notifier pipe timestamp to avoid excessive polling
In the named pipe notifier, notifications are broadcast by writing to the
pipe, waiting briefly, and then reading it back. When clients see the pipe
as readable, they report the uvars as potentially changed and fish will
sync against the uvar file.

Prior to this change, we synced repeatedly when the pipe was readable. But
we can do somewhat better by also checking the named pipe's timestamp (via
fstat). If the pipe has not changed, then we can skip the sync even if
there is currently data lingering on it.

With this change we should sync against the variable file less often
(typically once or twice per write); in the next change we refactor this
logic so it's easier to follow.
2021-05-04 11:59:12 -07:00
ridiculousfish
3a093e3ce8 Add a flog category for universal variable notifiers
Make it easier to debug this stuff.
2021-05-04 11:59:12 -07:00
ridiculousfish
8344289fac Give file_id_t a real constructor
Initialize it to invalid by default.
2021-05-04 11:59:12 -07:00
Fabian Homborg
c435d8b9b3 docs: Document enter/alt+enter harder
These were mentioned in "multiline editing", but not in the shared bindings
2021-05-04 20:00:46 +02:00
Fabian Homborg
d00576c9ea docs: More on join0 2021-05-04 14:14:27 +02:00
Fabian Homborg
d5f9fc84dc docs: Remove "note that"
It's one of my verbal tics, and I don't want it.
2021-05-03 18:39:54 +02:00
Fabian Homborg
1e13c60059 docs: Link relevant language sections from the tutorial
This allows us to keep the tutorial more focussed and leave the more
in-depth information in the "language" part of the documentation.
2021-05-03 18:15:24 +02:00
Fabian Homborg
0631bc509b Update copyright years
I hate this on principle, but as far as I know it has to be done.
2021-05-03 13:12:11 +02:00
Fabian Homborg
735105e33f bind tests: One more attempt to increase the timeouts
This is the last time I'm doing this before I rip these particular
tests out.

As far as I know there is no actual *problem* here, this is just
failing through a combination of macOS and Github Actions being slow
as molasses.

So it is wasting our time and therefore worse than not having these
tests at all, especially since they very rarely fail for good reasons.

We would leave some escape delay tests intact with generous timeouts, which would provide 90%
of the coverage with 10% of the hassle.
2021-05-03 12:13:18 +02:00
Fabian Homborg
8317b8bb8a Make ast FLOGs slightly less chatty
This removes the "did_visit" message because it doesn't really add
anything.

For example:

```
ast-construction: make job_list 0x55a6d19729f0
ast-construction: make job_conjunction 0x55a6d1971c00
ast-construction: will_visit job_conjunction 0x55a6d1971c00
ast-construction:   will_visit job 0x55a6d1971c18
ast-construction:     variable_assignment_list size: 0
ast-construction:     will_visit statement 0x55a6d1971c48
ast-construction:       make decorated_statement 0x55a6d1972650
ast-construction:       will_visit decorated_statement 0x55a6d1972650
ast-construction:         make argument_or_redirection 0x55a6d1968310
ast-construction:         will_visit argument_or_redirection 0x55a6d1968310
ast-construction:           make argument 0x55a6d197b0b0
ast-construction:         did_visit argument_or_redirection 0x55a6d1968310
ast-construction:         argument_or_redirection_list size: 1
ast-construction:       did_visit decorated_statement 0x55a6d1972650
ast-construction:     did_visit statement 0x55a6d1971c48
ast-construction:     job_continuation_list size: 0
ast-construction:   did_visit job 0x55a6d1971c18
ast-construction:   job_conjunction_continuation_list size: 0
ast-construction: did_visit job_conjunction 0x55a6d1971c00
ast-construction: job_list size: 1
```

those "did_visit" messages all correspond to "will_visit" ones. They
are effectively block delimiters like `end` or `}`.

If we remove them it turns into:

```
ast-construction: make job_list 0x55a6d19729f0
ast-construction: make job_conjunction 0x55a6d1971c00
ast-construction: will_visit job_conjunction 0x55a6d1971c00
ast-construction:   will_visit job 0x55a6d1971c18
ast-construction:     variable_assignment_list size: 0
ast-construction:     will_visit statement 0x55a6d1971c48
ast-construction:       make decorated_statement 0x55a6d1972650
ast-construction:       will_visit decorated_statement 0x55a6d1972650
ast-construction:         make argument_or_redirection 0x55a6d1968310
ast-construction:         will_visit argument_or_redirection 0x55a6d1968310
ast-construction:           make argument 0x55a6d197b0b0
ast-construction:         argument_or_redirection_list size: 1
ast-construction:     job_continuation_list size: 0
ast-construction:   job_conjunction_continuation_list size: 0
ast-construction: job_list size: 1
```

Which is still unambiguous because of the indentation.

(this is still *super verbose* and we might want to remove it from the
`*` "all" debug category and only allow turning it on explicitly)
2021-05-03 12:01:21 +02:00
Fabian Homborg
ae561c3702 bind tests: Sleep shorter, more often
We still wait 5s, but with higher resolution.

This allows that test to succeed within 100ms, instead of within 1s.
2021-05-03 11:26:41 +02:00
Fabian Homborg
d8c3d667d7 bind tests: More slack
As always, increase one escape delay and wait for a bit to enter
insert mode
2021-05-03 11:26:27 +02:00
ridiculousfish
0c79a8d3af Correct time.sleep to just sleep in bind.py
time was not imported, so this was raising an exception.
2021-05-02 11:25:33 -07:00
Fabian Homborg
202e5e53d5 Handle exit in keybindings immediately
This simply checks if the parser requested exit after running any
binding scripts (in read_normal_chars).

I think this means we no longer need the `exit` bind function.

Fixes #7967.
2021-05-02 20:27:08 +02:00
Johannes Altmanninger
28b17879c7 Install tmux to run tmux-tests on MacOS CI
Also install them explicitly on Linux, for better discoverability.
2021-05-01 22:51:35 +02:00
Johannes Altmanninger
c30a7cdfde Enable tmux-complete test in the CI
Just add some extra sleep time so it hopefully also works when the
CI system is overloaded. This succeeded >60 times in the CI, without
a single failure.

In case it legitimately fails again, we should provide simple steps
to reproduce the failure interactively (using "tmux attach").

The uvar issue only triggered because two fish are started - one is
running the tmux-complete script, the other one is running inside tmux.
We could reduce the complexity of this test by writing it in a
different language, like sh or python.
2021-05-01 22:51:35 +02:00
Johannes Altmanninger
b56b230076 Avoid excessive polling of universal variable file
Reproducible at least on Linux, where the "named pipe" universal
variable notifier is used:

	rm -rf build/test/xdg_config
	XDG_CONFIG_HOME=build/test/xdg_config ./build/fish -c "xterm -e ./build/fish"

The child fish reacts to keyboard input with a noticeable initial
delay.  This is because the universal variable file is polled over
a million times, even when I immediately press Control-D. This polling
prevents readb() from handling keyboard input.
Before commit 939aba02d ("Refactor input_common.cpp:readb"), readb()
reacted to keyboard input even when there were universal variable
notifications.  Restore this behavior, but make sure to call the
universal variable notifier after the new "prepare_to_select" logic.
Maybe the problem is in the notifier but the old behavior was sane.

Fixes the problems described in
7a556ec6f2 (commitcomment-49773677)

Adding "-d uvars-file" to the reproducesr shows that we are checking
the uvar file repeatedly:

	uvar-file: universal log sync
	uvar-file: universal log sync elided based on fast stat()
	uvar-file: universal log no modifications
2021-05-01 22:51:35 +02:00
Fabian Homborg
c55aa48308 Default colorscheme: Change pager prefix color for light terminals
From my checks (gnome-terminal with the "gnome light" colorscheme)
this seems to be the only color that's barely visible in a light
terminal, and it's the only color mentioned in both bug reports.

I'm leaving the artistic decisions to others, this is now *acceptable*
in both.

Note that, because we use universal variables here (hint #7317), this
will only be changed for preexisting installations when the user
reloads the colorscheme.

Fixes #3412
Fixes #3893
2021-05-01 20:16:23 +02:00
Fabian Homborg
4728d1772f Fix doc reference 2021-05-01 19:44:15 +02:00
Fabian Homborg
b16e537b66 Only set default fish_function_path when --no-config is used
Otherwise config.fish will keep $fish_function_path.
2021-05-01 19:43:31 +02:00
Fabian Homborg
4fd8673772 I'm going through CHANGELOG 2021-05-01 19:15:23 +02:00
Fabian Homborg
1908cf95de Double default cnf-handler
This was defined in config.fish.

Just define it here again, it's trivial.
2021-05-01 18:59:25 +02:00
Fabian Homborg
2416aa5337 Let --no-config imply private mode
This stops it from saving history.
2021-05-01 18:59:25 +02:00
Fabian Homborg
0420901cb2 default prompt: Set fish_color_status if unset
Otherwise this'll error with --no-config
2021-05-01 18:59:25 +02:00
Fabian Homborg
5ddb1adac1 Only use DATADIR in $fish_function_path if no-config is used
This only uses the functions fish ships with, but still doesn't allow
any *customization*, which is the point of no-config.

This makes it a lot more usable, given that the actual normal prompt
and things are there.

This still doesn't set any colors, because we don't run
__fish_config_interactive because we don't read config.fish (any
config.fish), because that would run the snippets.
2021-05-01 18:59:25 +02:00
Fabian Homborg
848f7a0787 Don't do uvars if no-config is in effect 2021-05-01 18:59:25 +02:00
Fabian Homborg
980365735a If no uvars are available, fall back to global when setting
Otherwise `set -U foo bar` if uvars aren't available would simply not
set *anything*.
2021-05-01 18:59:25 +02:00
Fabian Homborg
52f56e2119 WIP Add no-config mode
This loads *no* config, *at all*. Not even share/config.fish, so
$fish_function_path is entirely unset.
2021-05-01 18:59:25 +02:00
Fabian Homborg
b3926aca63 Ye olde changelogge 2021-05-01 18:54:33 +02:00
Fabian Homborg
2b74affaf0 Add prompt selector
It's a bit weird to *have* to fire up a browser to get fish_config to
choose a prompt.

So this adds a `prompt` subcommand to `fish_config`:

- `fish_config prompt list` shows all the available prompt names
- `fish_config prompt show` demos the available sample prompts
- `fish_config prompt choose` sources a prompt
- `fish_config prompt save` makes the choice permanent

A bare `fish_config` or `fish_config browse` opens the web UI.

Part of #3625.

TODO: This shows the right prompt on a new line. Showing it in-line is awkward
to do because we'd have to move it to the right.
2021-05-01 18:50:05 +02:00
Fabian Homborg
e548dca686 Webconfig: Fix initial tab
For some reason the url is now

http://localhost:$PORT/$RANDOM/#!/$TAB

while this created

http://localhost:$PORT/$RANDOM/#$TAB

which redirected to

http://localhost:$PORT/$RANDOM/#!/colors#$TAB

i.e. the "colors" tab with a useless unmatched anchor.
2021-05-01 18:47:49 +02:00
Johannes Altmanninger
daa3ae4be1 fish_config: use background color for some themes search matches
See https://github.com/fish-shell/fish-shell/issues/2442#issuecomment-829636721
2021-04-30 22:13:23 +02:00
Fabian Homborg
2e9dab71a3 __fish_apropos: Don't overwrite $dir 2021-04-30 20:09:56 +02:00
Fabian Homborg
c25efeed7a __fish_apropos: Fix broken variable name 2021-04-30 20:07:20 +02:00
Fabian Homborg
f485169391 __fish_apropos: Fix on macOS
Because MacOS' apropos is bad and doesn't support the `--` option
separator, this apparently spews errors.

Because the argument _can't_ start with a `-` (because we add a `^`),
we can just remove it.

Fixes #7965.
2021-04-30 19:16:57 +02:00
Fabian Homborg
2cea5b8eb1 Add a "prompt_login" helper function
This prints a description of the "host". Currently that's

`(chroot:debianchroot) $USER@$hostname`

with the chroot part when needed.

This also switches the default and terlar prompts to use it, the other
prompts have slightly different coloring or logic here.
2021-04-30 17:07:54 +02:00
Fabian Homborg
f768389cf7 fish_tests: Actually set locale
Otherwise this fails if the $PWD has non-ASCII characters.

Fixes #7962.
2021-04-29 08:00:05 +02:00
tomKPZ
7735d13d79 Fix prompt reflow in kitty terminal 2021-04-28 08:14:08 +02:00
Fabian Homborg
8cd5f6cfde funcsave: Don't save details
The "# defined in /path/to/file" comment here is, almost by
definition, wrong.
2021-04-27 16:33:41 +02:00
Johannes Altmanninger
9d7f6db792 fish_indent: preserve escaped newlines around variable assignments
In many cases we currently discard escaped newlines, since they
are often unnecessary (when used around &|;). Escaped newlines
are useful for structuring argument lists. Allow them for variable
assignments since they are similar.

Closes #7955
2021-04-27 00:13:48 +02:00
Johannes Altmanninger
15e265f209 Don't read user configuration in tmux-complete test
As discussed in 7a556ec6f2 (commitcomment-49671741)
2021-04-25 13:32:14 +02:00
Fabian Homborg
6aade380c1 Sample prompts: Handle print_pipestatus if TERM=dumb
This is the simple solution of just quoting it. The real solution
would probably handle `set_color` with no color better - #5443.

Fixes #7904.
2021-04-25 09:49:18 +02:00
Fabian Homborg
58885fbd0b docs: Handle undefined LINK_SUFFIX
When building the docs with an old sphinx (like e.g. on Debian), this
would break links in the search results.

This happens because we've nabbed the searchtools.js from a sphinx to
add our special handling of short builtins like "and", "end", "cd" (as
part of #7757).

I don't believe this will change *a lot* in practice, so it's probably
still okay, but this hack is still worthwhile.

See #7946
2021-04-25 09:42:02 +02:00
Fabian Homborg
981a07d4c7 cmake: Error out with "-static"
I'm not entirely sure this *has* to be given via
CMAKE_EXE_LINKER_FLAGS, but this would have stopped at least one
person from trying.

Static linking 1. does not work at the moment, 2. is not *useful*. You
don't get a single-file fish you can just copy somewhere because
you're missing our functions. On glibc systems you also can't
statically link glibc. Given all that, it does not appear to be worth
putting in any effort to make it work (if it's possible at all).

See #7947.
2021-04-25 09:38:04 +02:00
Fabian Homborg
3cccb77b52 Make test error when number is invalid nicer
This would print the default "Argument is invalid" error string, which
is *true* but not super obvious, because `test` doesn't always perform
numeric conversion, and that's the bit that failed here.
2021-04-24 11:18:58 +02:00
ridiculousfish
fc0dd49842 Attempt to fix the bind test on MacOS
Wait for the command line to "catch up" to what is sent.
Use expect_str rather than hard-coded delays.
Fixes #7942
2021-04-22 13:15:40 -07:00
Fabian Homborg
2095d744cf README: Remove "try in browser" leftovers
This was missed in 5a53ead240.
2021-04-22 18:25:28 +02:00
Fabian Homborg
4e41a2bc9f CHANGELOG Remove reverted git change
56af5d0702 reverted the bit that showed
staged state if dirty state wasn't active.
2021-04-22 16:25:00 +02:00
Fabian Homborg
281817f2c5 CHANGELOG prompt stuff 2021-04-22 16:24:38 +02:00
ridiculousfish
42d674819f Make the kill ring thread-safe
Now that the kill ring may be accessed on a background thread, ensure it
is thread safe.
2021-04-21 17:37:44 -07:00
Karolina Gontarek
9d66ddc840 Rename variable to fish_killring 2021-04-21 16:39:29 -07:00
Karolina Gontarek
da97daa800 Add variable to Special variables section 2021-04-21 16:39:29 -07:00
Karolina Gontarek
539837f317 Add variable to documentation 2021-04-21 16:39:29 -07:00
Karolina Gontarek
f1ece78b67 Add CHANGELOG entry 2021-04-21 16:39:29 -07:00
Karolina Gontarek
ed64cf5e34 Implementation of variable with killring entries 2021-04-21 16:39:29 -07:00
ridiculousfish
0a559ac457 Reformat source files with clang-format 2021-04-21 13:31:58 -07:00
Fabian Homborg
f21e015f1b webconfig: Make blue, green, red a bit brighter
These were hard to read in the browser, but not in the terminal.

The palette in color.cpp lists #000080 for blue, which is *even darker*. I'm not sure if that's actually a thing - I was under the impression that table was taken from xterm.

Either way, listing it in this color doesn't do anyone any favors. It's just a rough approximation anyway.
2021-04-21 17:26:52 +02:00
Fabian Homborg
152b0ef018 Webconfig: Sort the prompt list
Otherwise this has filesystem order, which on my system is quite
chaotic.

An alternative would be to randomize the order so people see different
prompts each time.
2021-04-21 17:13:03 +02:00
Fabian Homborg
f2364103b4 Sample prompts: Add a simplified version of my own prompt
Some features:

- A nice `►` prompt char with a fallback for non-utf8 systems
- The $PWD is colored depending on its sha, so different directories
  are colored differently, but each directory stays the same
- User@Host is only shown if not on the local machine (ssh or
  virtualization)
- A right prompt with a nice git display, date, duration of the last
  command (if it took over 100ms), and virtualenv
2021-04-21 17:01:05 +02:00
Fabian Homborg
4355636386 webconfig: Handle right prompt
This gets fish to print the right prompt of any sample if it has any,
and then shows it separately.

If there is a right prompt, it will also save it. If not, it will *not* overwrite an existing right prompt.
2021-04-21 17:01:05 +02:00
Johannes Altmanninger
2fff12104d Correct test environment setup
XDG_RUNTIME_DIR was misspelled.
XDG_DATA_DIRS could affect tests. Remove it since it's used read-only.
2021-04-21 00:47:03 +02:00
ridiculousfish
f4bcfd9085 Correct behavior of string match variable import with multiple arguments
This refactors the behavior of string match with capture groups to
correctly handle multiple arguments. Now the variable capture applies to
the first match, as documented. Fixes #7938.
2021-04-20 15:15:52 -07:00
ridiculousfish
abd59c50b0 Add a test for invalid regex variable names
Also apply some mild refactoring.
2021-04-20 15:15:52 -07:00
ridiculousfish
8e95bba25e Clean up and reduce some allocations in env.cpp 2021-04-20 15:15:52 -07:00
Fabian Homborg
9c413b039d Also fix tokenizer_state in bracketed paste path
Also removes our remaining use of
`__fish_commandline_is_singlequoted`.

See #7782.
2021-04-20 15:29:28 +02:00
Fabian Homborg
dc57ba01a2 __fish_pwd: Just always define the cygwin version
This called `uname` just to check if we *should* shorten "cygdrive"
directories.

That's more annoying than just doing it by default - on my system `pwd
| string replace` takes about 100 *micro*seconds, and this is done
once per prompt. Anyway, using $PWD further speeds it up to ~30
microseconds (compared to 10-20 for just `pwd`). This is hard to
measure because it's heavily impacted by system hitter.

The alternative is to ask cygwin to ship this feature as a patch.
2021-04-19 18:58:00 +02:00
Fabian Homborg
c95a223f5e Better errors when calling a command in a command substitution fails 2021-04-19 16:47:17 +02:00
Fabian Homborg
04f1254c94 Disable tmux tests for now
These are just broken at the moment
2021-04-19 16:46:50 +02:00
ridiculousfish
e8a6d31aea Correct behavior of string match and unmatched capture groups
string match is documented as setting an unset variable if a capture group
is unmatched in an otherwise matched regex, and if the `--all` flag is not
provided. However prior to this fix, it instead set a variable containing
the empty string as a single value. Correct the implementation to match
the documentation.

Note that if the `--all` flag is provided we continue to set empty
strings, which is documented.
2021-04-18 21:04:25 -07:00
ridiculousfish
1aa8200b96 Minor cleanup of builtin_string regex
Mark some classes as final and remove some unnecessary variables.
Add a test in preparation for the next fix.
2021-04-18 20:39:14 -07:00
ridiculousfish
092168485b Remove wcstring_tok
wcstring_tok was a funky function which was confusing and used only in
one place. Replace it with split_string_tok, which is somewhat simpler.
2021-04-18 14:46:05 -07:00
ridiculousfish
2fb0a703de Simplify rgb_color_t::try_parse_named
This came out of an investigation into making strings immutable.
This code did "lazy" lowercasing but we can simplify it by just
providing our own case-insensitive compare routine, which is good
enough for colors.
2021-04-18 12:11:38 -07:00
Fabian Homborg
0111eafbbc tmux tests: Actually use absolute $XDG paths
Erasing $XDG_CONFIG_HOME here means it falls back on the default,
which is ~/.config/, which means it reads user configuration!
2021-04-18 21:09:48 +02:00
Johannes Altmanninger
6b41227ff4 completions/dnf: minor addition to always show RPM files
See #7928
2021-04-18 13:09:36 +02:00
Josh Leichtung
f99127a158 Fix spelling of wheel in Wildcards docs 2021-04-18 07:47:52 +02:00
ridiculousfish
7a556ec6f2 Additional work on tmux-complete test
This removes the relative XDG paths, which could have potentially
confused tmux, and also starts the window with the correct size
instead of adjusting the size afterwards.
2021-04-17 16:43:28 -07:00
ridiculousfish
f7cef13b9b Partially fix the tmux-complete test
The autosuggestion was creeping in, causing us to sometimes show file-1
and sometimes just file-. Allow the race through a regular expression.
2021-04-17 16:43:28 -07:00
ridiculousfish
467755bf4a Bravely optimize job_reap
job_reap is now called more often. This optimizes it by doing an
early-out if there are no running jobs (common at the prompt) and also
skipping the save/restore status, since by inspection we also save and
restore the status when running event handlers.
2021-04-17 16:43:28 -07:00
ridiculousfish
7c153a8307 Introduce prepare_to_select, fixing job_summary.py
This concerns printing status messages for background jobs which have
stopped or finished. Previously fish would do this from two places:

1. Before running a command (including empty string)
2. If a signal is received during select()

So if the job finishes while fish is doing something else (like running an
event handler) then we would not print status messages until the user hit
return. This caused the job_summary.py test to be flaky.

Fix this by splitting the interrupt handler into two parts: a part that
handles signals (e.g. triggering exit from the reader), and a part that
always runs just before blocking in select(). This second part always
reaps jobs and prints their status messages. This narrows the window for a
job exit to be "missed" before fish blocks in select, and should make the
job_summary.py test more reliable.
2021-04-17 16:43:28 -07:00
ridiculousfish
3684c91ad2 Make input_event_queue_t a base class
This concerns the problem of "injecting" fancy fish bits like job reaping
into the "common" input stuff which is also used by fish_key_reader.
Instead of providing a callback, make the input event queue a base class
with virtual functions. This allows for a richer interface and simplifies
some memory management issues.
2021-04-17 16:43:28 -07:00
ridiculousfish
939aba02de Refactor input_common.cpp:readb
readb is used to read a single byte from stdin, or maybe update universal
variables, or maybe invoke completion handlers, etc. Previously it
returned char_event_t but this is more complex than necessary; instead we
can just have it return a single byte, or one of a few special error
codes. This makes the readb's role more clear.
2021-04-17 16:43:28 -07:00
ridiculousfish
78147abe8a Switch the interrupt handler from a global to an instance variable
"The" interrupt handler is used when we get a signal while waiting at the
prompt. Switch it from a global function pointer to an std::function. This
is a mild refactoring which itself will be replaced soon.
2021-04-17 16:43:28 -07:00
ridiculousfish
060ce4f7da Remove timeout input events
Now that timeouts are stored in the event queue peeker, we can remove the
notion of timeout events altogether. Instead you may ask for an event with
a timeout, and get back none on timeout. This simplifies how input events
work.
2021-04-17 16:43:28 -07:00
ridiculousfish
bd72791340 Use event_queue_peeker_t when matching key bindings
Previously, when attempting to match a key binding, we would dequeue
events from the queue and put them back on if the binding fails. The
tricky part is timeouts: distinguishing between an escaped character and
the escape key itself. This was handled with "timeout events" and we had
to be careful to know when to discard them.

Switch to a new model: use event_queue_peeker more pervasively.
Temporarily dequeued events are stored in the peeker, and the peeker
itself remembers when it has seen a timeout. This is in preparation for
removing the idea of "timeout events" altogether.
2021-04-17 16:43:27 -07:00
ridiculousfish
c570a14c04 Simplify event_queue_peeker_t
Make it an ordinary struct wrapping a vector, instead of a template.
This is in preparation for using it more widely, for matching bindings
as well as mouse CSI sequences.
Also add some mouse-disabling tests.
2021-04-17 16:43:27 -07:00
ridiculousfish
e8a61ef4aa Introduce select_wrapper_t
select_wrapper_t wraps up the annoying bits of using select(): keeping
track of the max fd, passing null for boring parameters, and
constructing the timeout. Introduce a wrapper struct for this and
replace the existing uses of select() with the wrapper.
2021-04-17 16:43:27 -07:00
ridiculousfish
0dd24c8f74 Correct nfds argument to select()
In readch_timed, we were passing 1 as the number of fds. This is correct if
the fd is 0 (stdin) which it typically is; however this will fail if in_ is
not stdin. Switch to in_ + 1.
2021-04-17 16:43:27 -07:00
ridiculousfish
48b42c0255 Reorganize input_event_queue_t declaration
This moves the private bits to the bottom. No functional change.
2021-04-17 16:43:27 -07:00
ridiculousfish
3b32a32dda Replace some format_strings with to_string
This is hopefully a little faster and a little safer as there's
no format string involved.
2021-04-17 16:43:27 -07:00
ridiculousfish
be9579418f Refactor to use has_external_proc instead of a manual loop
No functional change here.
2021-04-17 16:43:27 -07:00
ridiculousfish
e299f89db3 Rename print_job_summary to call_job_summary
No functional change; this is simply a less misleading name.
2021-04-17 16:43:27 -07:00
Johannes Altmanninger
db0fe92aaa completions/dnf: cautiously complete RPM files
Complete RPM files instead of pacakges if there is either
1. a slash in the token, which precludes package names
2. no matching package

To enable 2, pass the commandline token to the dnf query, instead of
an undefined variable. This allows SQL injection; not sure if we care.

We could always complete RPM files but maybe that's too noisy.
Also, isn't that what the "rpm" command is for?

Closes #7928
2021-04-17 22:53:34 +02:00
Johannes Altmanninger
75142f0cde Add Dockerfile for Fedora 2021-04-17 22:53:34 +02:00
Johannes Altmanninger
d96a2e7052 Make docker script work when CDPATH is set
Since #3914 we convert empty CDPATH entries to ".", which makes them
easier to use in fish scripts. This has backfired here, because bash's
cd prints the directory if the "." entry from CDPATH is used.
From bash(1) on cd:

> If a non-empty directory name from CDPATH is used, or  if  -  is
> the  first argument, and the directory change is successful, the
> absolute pathname of the new working directory is written to the
> standard output.

My preferred fix would be to convince bash to amend "non-empty
directory" to "non-empty directory other than .".
2021-04-17 22:53:34 +02:00
Johannes Altmanninger
b3c520cc47 README: link to the Building section 2021-04-17 22:53:34 +02:00
Fabian Homborg
4bcecc8983 docs: Make background at least one screen tall
Otherwise this would look ugly by stopping the gradient after the
content, so in e.g. the `end` or `false` page it would leave an ugly stripe at
the bottom.
2021-04-17 17:36:32 +02:00
Fabian Homborg
d9b212f60b docs: Move some more sections from index to language
These aren't a 100% *exact* fit, but they're mostly language features.
2021-04-16 18:06:33 +02:00
Fabian Homborg
8bc7a85a69 docs: Remove #anchor links
Fixes at least one broken link to syntax
2021-04-16 18:06:33 +02:00
Collin Styles
42c11f1b6c Remove completion files for ls aliases; just use function --wraps 2021-04-16 17:40:55 +02:00
Fabian Homborg
5a53ead240 README: Remove rootnroll
This was removed from fish-site in
7c19bf2cc9a3742346527cd6979671f16b8caeb9 because it's out of date, so
it gives a bad first impression.

In my tests it also loads very slowly and features oh-my-fish instead
of a stock fish.
2021-04-16 15:47:18 +02:00
Fabian Homborg
3b87547411 Fix skipping locale tests on Github Actions 2021-04-16 09:01:41 +02:00
239
5e66722452 Update completions for resolvectl 2021-04-15 17:38:26 +02:00
239
4688a84398 Update completions for loginctl 2021-04-15 17:38:26 +02:00
239
9b85254717 Update completions for Keybase 2021-04-15 17:38:26 +02:00
239
975cd13108 Update completions for cryptsetup 2021-04-15 17:38:26 +02:00
Fabian Homborg
fff158fd2b tests: Disable locale.fish on Github Actions
Sometimes hangs with tsan.

Works around #7934.
2021-04-15 17:26:08 +02:00
Fabian Homborg
9850f8d18a docs: Update status docs
`status --current-function` is not a thing.
2021-04-14 21:46:51 +02:00
Fabian Homborg
84087f09d4 webconfig: Remove gigantic padding 2021-04-14 20:49:24 +02:00
Fabian Homborg
7eddf48cfa webconfig: Cleanup running prompts 2021-04-14 19:08:33 +02:00
Fabian Homborg
333032f626 tests: Increase how long exit_nohang tries
This runs in 100ms increments, so there's not a lot of harm in trying
longer - it should take the same time everywhere it succeeded before.

But I've reproduced failures on FreeBSD 13 on sr.ht, so there's at
least one platform where a total time of 1 second isn't enough.

Now we do 50 tries, which is 5 seconds.
2021-04-14 18:55:11 +02:00
Fabian Homborg
ef96a6614b Update termsize before a sigwinch handler
This could have been one iteration off, e.g.

```fish
function on-winch --on-signal winch
    echo $LINES
end
```

Resize the terminal, it'll print e.g.

24

then run `echo $LINES` interactively, it might have a different answer.

This isn't beautiful, but it works. A better solution might be to make
the termsize vars electric and just always update them on read?
2021-04-14 17:27:53 +02:00
David Adam
9db846a5a7 docs: some improvements to the notes on key bindings
Includes acknowledgement that these are not full editors. Closes #4023.
2021-04-14 21:43:14 +08:00
Fabian Homborg
56af5d0702 Revert "git prompt: Show stagedstate without dirtystate"
After further thinking, showing this now, by default, without a nice way to turn it off isn't great.

This reverts commit 573fed7798.
2021-04-13 19:10:04 +02:00
Xirui Zhao
8bbb06bf5c vi mode: bind u/C-r to undo/redo in place of history search (#7908) 2021-04-13 18:47:34 +02:00
Fabian Homborg
5750351210 Update CHANGELOG 2021-04-13 16:58:22 +02:00
Fabian Homborg
4fa17bd512 git prompt: Don't compute bits we don't need 2021-04-13 16:44:46 +02:00
Fabian Homborg
573fed7798 git prompt: Show stagedstate without dirtystate
I have *no idea* why this was coupled, especially since dirtystate can
be expensive, staged state should not be.
2021-04-13 16:44:46 +02:00
Fabian Homborg
71166274a2 git prompt: Respect status_order even without informative status
Fixes #7926.

Also switches the default status order for non-informative to the informative one:

stagedstate invalidstate dirtystate untrackedfiles stashstate

instead of

dirty staged stash untracked
2021-04-13 16:44:46 +02:00
Fabian Homborg
a65933551d git prompt: Allow setting __fish_git_prompt_status_order
See #7926
2021-04-13 16:44:46 +02:00
Fabian Homborg
db7278bac6 git prompt: Remove that massive documentation block 2021-04-13 16:44:46 +02:00
Jason
80b2eb94f1 alias: print error msgs to stderr 2021-04-13 15:50:00 +02:00
Fabian Homborg
3e473b9f37 io: Silence write error with EPIPE
With something like

```
history | head -n 1
```

this would error "write: Broken pipe", which is just annoying. There
is no *problem* here, `head` closes this on purpose.

Fixes #7924.
2021-04-13 10:38:17 +02:00
David Adam
a918cabf5e feature flags: default stderr-nocaret to on 2021-04-12 22:18:48 +08:00
David Adam
2e44076397 feature flags: add the notion of a default value for each flag 2021-04-12 22:18:48 +08:00
Fabian Homborg
053acf5c6b bind ctrl-space only as a *preset* binding
Fixes #7922
2021-04-11 20:39:54 +02:00
Fabian Homborg
d31d7e4880 docs: Add missing newline 2021-04-11 18:44:19 +02:00
Fabian Homborg
7210261513 complete: Obey --force-files without an option
Things like

```fish
complete command -n '__fish_seen_subcommand_from subcommand'
--force-files
```

would not be obeyed because we only checked force-files when there was
an option.

Fixes #7920.
2021-04-10 21:58:40 +02:00
Fabian Homborg
3100cd1bb7 CHANGELOG 2021-04-10 17:20:27 +02:00
Fabian Homborg
bc4d597e91 Don't abandon line before the first prompt
When a terminal in a tiling WM starts, it might start the shell before
it has reached its "final" size. So we get the terminal width,
then the terminal would be resized (to appease the tiling logic),
and then we would print the abandon line with the omitted newline
char, only if the size got smaller (likely!), we would overflow the
line and land on the next.

So what we do is a bit of a hack: We don't abandon the first line.

This means that `printf %s foo; fish` will overwrite the `foo`, but
that's a super small problem and I don't see another way around this.

Fixes #7893.
2021-04-10 17:13:44 +02:00
Fabian Homborg
16d4424f6c webconfig: Only include path in error if we have one
This makes for a super misleading error message.

See #7917.
2021-04-10 11:53:36 +02:00
Fabian Homborg
e2146a0eee complete: Stop using the function definition as the description
This isn't helpful, and entirely unreadable. Excerpt:

```
__fish_git_prompt_set_char  (set -l user_variable_name "$argv[1]" set -l char $argv[2] if set -q argv[3] and begin set -q __fish_git_prompt_show_informative_status or set -q __fi…)
```

Fixes #7911.
2021-04-08 15:36:59 +02:00
Fabian Homborg
4239ba133d Sample prompts: Add a "simple" prompt
This should be a simple prompt that doesn't place a huge strain on the
system but communicates the most important information simply and
effectively.

It should be a good jumping off point for making your own prompt.
2021-04-08 11:14:16 +02:00
Fabian Homborg
d4ce5507af Sample prompts: Rename classic+vcs to default
That's what it is, and without the "classic" prompt to compare it
doesn't make any sense anymore.
2021-04-08 11:14:16 +02:00
Fabian Homborg
34d4afac99 Sample prompts: Remove stray space after pipestatus
This would, with the default color, have an ugly red background.

So just remove the space.
2021-04-08 11:14:16 +02:00
Fabian Homborg
db9ac527af Sample prompts: Rename prompts named after a single person
Unless that person directly contributed the prompt.

We name them after a feature - the Scales prompt feature a ">>>" which
kinda looks like fish scales, the "Arrow" prompt starts with a
prominent "➜".

Naming them after people looks like an endorsement of that particular
person, and like they are someone to look up to, especially when they
aren't involved with the project.

The "terlar" and "acidhub" prompts stay for now because they
contributed the prompt themselves, they are also much less prominent.
2021-04-08 11:14:16 +02:00
Fabian Homborg
635a2c13f1 Sample prompts: Use fish_is_root_user
So we don't just check for "root"
2021-04-08 11:14:16 +02:00
Fabian Homborg
2bc2a92c9a Sample prompts: Stop using "git status" just to see if it is dirty
`git status` will descend the entire repo, which is *slooooow*
2021-04-08 11:14:16 +02:00
Fabian Homborg
31f86ed2cf Sample prompts: Use fish_git_prompt format string 2021-04-08 11:14:16 +02:00
Fabian Homborg
0a395b9568 Sample prompts: Remove default settings from informative vcs prompt
Some of these are just the git prompt defaults anyway, so remove them here.
2021-04-08 11:14:16 +02:00
Fabian Homborg
0586715696 Sample prompts: Remove duplicated or less useful prompts
The "classic" prompts are all just variations on a theme, let's just
keep the default classic+vcs.

"Justadollar" is very unlikely to be what you want and also trivial to
write yourself.

I have no idea what screen_savvy even is for - it reacts to "$WINDOW",
but I don't know anything that even uses that variable.

Lonetwin is just unremarkable, and the debian chroot prompt has one special feature that should be integrated into the other prompts.
2021-04-08 11:14:16 +02:00
David Adam
783736c77f Merge branch 'Integration_3.2.2' 2021-04-07 21:09:25 +08:00
David Adam
fd184cb4ea GitHub Actions: drop UBSan suppressions
These were only needed on Travis, and only worked there in this form.
2021-04-07 20:29:54 +08:00
David Adam
a1f55b1b73 GitHub Actions: run tests against all branches 2021-04-07 20:27:58 +08:00
David Adam
0efa471339 CHANGELOG: remove items fixed in 3.2.2 2021-04-06 22:39:57 +08:00
David Adam
32438faf86 CHANGELOG: note #7900 2021-04-06 22:37:44 +08:00
David Adam
b05275cedc docs: remove undo-group functions from documentation
As discussed in
85ffa77b4e
these functions are not intended for long term use.

Also fix a typo introduced in 85ffa77.
2021-04-06 21:18:21 +08:00
exploide
89eeafe393 added completions for firewall-cmd (firewalld)
based on --help and man page of firewall-cmd 0.9.x
2021-04-05 18:59:58 -07:00
ridiculousfish
ed51e2baac Prevent hanging when restoring the foreground process group at exit
When fish starts, it notices which pgroup owns the tty, and then it
restores that pgroup's tty ownership when it exits. However if fish does
not own the tty, then (on Mac at least) the tcsetpgrp call triggers a
SIGSTOP and fish will hang while trying to exit.

The first change is to ignore SIGTTOU instead of defaulting it. This
prevents the hang; however it risks re-introducing #7060.

The second change somewhat mitigates the risk of the first: only do the
restore if the initial pgroup is different than fish's pgroup. This
prevents some useless calls which might potentially steal the tty from
another process (e.g. in #7060).
2021-04-05 17:44:14 -07:00
ridiculousfish
a69e94d954 add_disowned_job to accept its parameter by const pointer
It never modified the job.
2021-04-03 21:05:32 -07:00
ridiculousfish
73ec89917a Remove the SIGIO signal handler and universal notifier
If fish launches a program and that program marks stdin as O_ASYNC, then
fish will start receiving SIGIO events on Mac. This occurs even though
the file descriptor itself does not have the O_ASYNC flag set.

SIGIO is reported as interrupting select which then breaks multiple-key
bindings, especially in vi-mode.

As the SIGIO based universal notifier is disabled, remove it and the
SIGIO handler itself. This allows fish to ignore properly ignore SIGIO.

Fixes #7853
2021-04-03 18:11:29 -07:00
ridiculousfish
36ad116b34 Properly report errors when builtin output fails
This correctly sets $status when a builtin succeeds but its output fails;
for example if the output is redirected to a file and that write fails.

Fixes #7857
2021-04-03 16:11:25 -07:00
Phil Corbett
13439b399e Shortens RPM completions 2021-04-02 12:37:59 -07:00
Fabian Homborg
19004642ba __fish_apropos: Define again on non-macOS
This had a weirdly broken if condition.
2021-04-02 16:58:34 +02:00
Aaron Gyes
b9b2010342 rebuild whatis database weekly, not daily
I still don't think we even address rebuilding
manpage completions yet. Maybe they could share a
solution.
2021-04-02 02:12:00 -07:00
Aaron Gyes
0e03e49eb9 __fish_apropos: prepend $argv with ^
Because macOS' `apropos` is just using grep, and we only need
a prefix match for __fish_describe_command, we can shave off
some ok total execution time here.
2021-04-02 01:58:38 -07:00
Aaron Gyes
85e3381480 __fish_apropos: refactor, limit to 10.15+, change default cache dir.
No longer uses the __fish_apropos hack on every version of macOS.
Juat Catalina+.

The whatis database generated and replaced daily is 2 megabytes on
my computer, and in ~/.cache on a home dir might wind up on a net
mount or something annoying. or, definitely it's backed up by default.

It's wiser to throw that junk in with other cache files on the system
aka DARWIN_USER_CACHE_DIR, and only use the XDG directory if
someone specifically configured that.

Mainly, this just means at least it won't automatically get backed
up by Time Machine and stuff every day, which is no big deal but
y'know...

Rearranged stuff a little to not shell out every time.
2021-04-02 01:58:38 -07:00
Johannes Altmanninger
ed5e5a9d49 Enhance greppability of the "return symbol" for abandoned newlines
Was looking for this for #7893
2021-04-02 08:09:56 +02:00
Fabian Homborg
e19a2f9f85 Github: Force using vendored pcre2
It seems an update to the ubuntu image github uses included pcre2, but
only the 64-bit version.

So since we now force a 32-bit fish but don't force the vendored pcre,
it complains.

Simply force the vendored pcre as well as I don't believe it's worth
it to change the pcre2 detection in this case.
2021-04-01 22:58:25 +02:00
David Adam
16bc170126 CHANGELOG: work on 3.3.0 2021-04-01 23:42:56 +08:00
Fabian Homborg
e56d8a8e5e Changelog new fish_mode_prompt 2021-03-31 18:06:17 +02:00
Fabian Homborg
419675b9e5 mode_prompt: Use foreground instead of background colors
The default vi mode prompt is kind of ugly, mostly because we include
this `[I]` with a super bright green background and white text,
which is particularly grating because most prompts don't actually have
a background.

So we get a ton of people asking "How do I remove this [I]" when they
could really benefit from having the mode shown.

There's a few ways to make this look nicer, the simplest is to just
keep the same colors but use them as foreground instead of background
colors, which looks much more understated.

The mode prompt is important, but not more than the actual contents of
the commandline, so it shouldn't have ALARMING colors.
2021-03-31 18:04:53 +02:00
Fabian Homborg
f1d3e7a0db docs: Reorder ToC
Roughly the order I expect these to be used in.
2021-03-31 17:21:46 +02:00
Fabian Homborg
b5a5d98f80 docs: Add missing "`"
Fixes a sphinx warning.
2021-03-31 17:21:46 +02:00
Fabian Homborg
dbd608cb6a tinyexpr: Use cmath with std::
The oldschool math.h imports the math functions into the global
namespace, cmath imports them into std::.

Unfortunately, we already use cmath elsewhere, and including math.h
doesn't reimport them in some systems, so now they can't find them
with std::.

Fixes #7882.
2021-03-31 17:21:46 +02:00
David Adam
0c03a0267f Revert "tinyexpr: use std:: namespace for older libstdc++"
This reverts commit f46444f106.

This commit does not build on macOS or RHEL 7.
2021-03-31 22:53:18 +08:00
David Adam
f46444f106 tinyexpr: use std:: namespace for older libstdc++
Fixes the build on Ubuntu Xenial 16.04 and CentOS 7.
2021-03-31 11:21:42 +08:00
David Adam
85ffa77b4e docs: note undocumented input functions
Noted in #7828.
2021-03-31 10:41:21 +08:00
Michael Jarvis
f9e95e5f5b Fix Sphinx warning
For some reason, the space in seems to cause a problem.

```
../CHANGELOG.rst:30: WARNING: Inline literal start-string without end-string.
```
2021-03-30 18:05:37 +02:00
Fabian Homborg
f75cf5c16b git prompt: Use status --porcelain for informative status
This allows us to stop descending into untracked directories, which
can be faster.

It's still not *good* - git can still be quite slow here, but if
there's an untracked directory you probably don't care about the
number of files in that.

Fixes #7871.
2021-03-30 17:51:34 +02:00
Fabian Homborg
93ce805f32 help: Update completions
This is all of the sections in interactive, language and for_bash_users.

The faq names are so long that we're not adding them, also not all of
these have descriptions yet.
2021-03-30 17:40:38 +02:00
Fabian Homborg
ed9268f99c math: Make function parentheses optional (#7877)
* math: Make function parentheses optional

It's a bit annoying to use parentheses here because that requires
quoting or escaping.

This allows the parens to be omitted, so

math sin pi

is the same as

math 'sin(pi)'

Function calls have the lowest precedence, so

math sin 2 + 6

is the same as

math 'sin(2 + 6)'

* Add more tests

* Add a note to the docs

* even moar docs

Moar docca

* moar tests

Call me Nikola Testla
2021-03-30 17:21:28 +02:00
Fabian Homborg
d5cba5fe12 Teach help to pick the correct page
Given that we no longer have that massive "index" page with
everything, it's become harder to open the correct section
immediately.

So this hardcodes the section titles for each page in help itself.

This was half-automated with

grep -o 'a class="headerlink" href="#[^"]*"' /usr/share/doc/fish/faq.html | sort -u | string replace -r '.*#' '' | string trim -c '"'

The completions still need to be adjusted.
2021-03-30 17:14:14 +02:00
Fabian Homborg
18e332772d functions: Add "--no-details" flag and use it in funced
This inhibits the function path comment which is annoying in `funced`.

Fixes #7879.
2021-03-30 16:54:26 +02:00
Karolina Gontarek
da2f7999ad Fix backward-kill-path-component erasing extra tokens (#7872)
Fixes #6258
2021-03-29 22:58:50 +02:00
Fabian Homborg
fd4803ac6a Update BEL comment
We no longer send it.
2021-03-29 18:03:36 +02:00
Fabian Homborg
70813eb878 Update CHANGELOG 2021-03-29 18:00:38 +02:00
Fabian Homborg
312cfacf71 Don't ring the bell in reader_flash
The bell is a mechanism for important notifications. Not having things
to do in response to a keypress isn't important enough, especially
because we're already flashing and the bell might actually be a bell.

Fixes #7875.
2021-03-29 17:49:47 +02:00
Fabian Homborg
e1d19cf571 Don't touch $SHLVL if not interactive
It's not super clear what $SHLVL is useful for, but the current
definition is essentially
"number of shells in the parent processes + 1"

which isn't *super useful*?

Bash's behavior here is a bit weird in that it increments $SHLVL
basically always, but since it auto-execs the last process it will
decrement it again, so in practice it's often not incremented.

E.g.

```
> echo $SHLVL
1
> bash -c 'echo $SHLVL; bash'
2
>> echo $SHLVL
2
```

Both bashes here end up having the same $SHLVL because this is
equivalent to `echo $SHLVL; exec bash`. Running `echo $SHLVL` and then
`bash -c 'echo $SHLVL'` in an interactive bash will have a different
result (1 and 2) because that doesn't *exec* the inner bash.

That's not something we want to get into, so what we do is increment
$SHLVL in every interactive fish. Non-interactive fish will simply
import the existing value.

That means if you had e.g. a bash that runs a fish script that ends up
opening a new fish session, you would have a $SHLVL of *2* - one for the
bash, and one for the inner fish.

We key this off is_interactive_session() (which can also be enabled
via `fish -i`) because it's easy and because `fish -i` is asking for
fish to be, in some form, "interactive".

That means most of the time $SHLVL will be "how many shells am I deep,
how often do I have to `exit`", except for when you specifically asked
for a fish to be "interactive". If that's a problem, we can rethink it.

Fixes #7864.
2021-03-29 17:44:13 +02:00
Hirokazu Hata
f1c93a99f9 changelog: fix missiong inline literal end-string
When building the document with Sphinx, the following warning is displayed, so add end-string.
"../CHANGELOG.rst:29: WARNING: Inline literal start-string without end-string."
2021-03-29 17:05:23 +02:00
ridiculousfish
0f0995cad0 Remove unused COMMAND_NOT_BUILTIN enum
This was an enum whose values were never used; we can just remove it.
2021-03-28 22:19:36 -07:00
ridiculousfish
0aec597a36 Switch a cast from C style to C++ style 2021-03-28 20:04:34 -07:00
ridiculousfish
48868e5667 Switch builtin execution to the performer model
In preparation for concurrent execution, introduce a
`get_performer_for_builtin` function. This function itself returns a
function, which when called will run the builtin. The idea is that the
function may be called on a background thread (but not in this commit).
2021-03-28 15:31:25 -07:00
ridiculousfish
fb92ad946b Rework null terminated arrays
Several functions including wgetopt and execve operate on null-terminated
arrays of nul-terminated pointers: a list of pointers to C strings where
the last pointer is null. Prior to this change, each process_t stored its
argv in such an array. This had two problems:

1. It was awkward to work with this type, instead of using std::vector,
etc.
2. The process's arguments would be rearranged by builtins which is
surprising

Our null terminated arrays were built around a fancy type that would copy
input strings and also generate an array of pointers to them, in one big
allocation.

Switch to a new model where we construct an array of pointers over
existing strings. So you can supply a `vector<string>` and now
`null_terminated_array_t` will just make a list of pointers to them. Now
processes can just store their argv in a familiar wcstring_list_t.
2021-03-28 15:31:25 -07:00
ridiculousfish
e0e4b11dbd Make arguments to builtins const
Prior to this change, builtins would take their arguments as `wchar_t **`.
This implies that the order of the arguments may be changed (which is
true, `wgetopter` does so) but also that the strings themselves may be
changed, which no builtin should do.

Switch them all to take `const wchar_t **` instead: now the arguments may
be rearranged but their contents may no longer be modified.
2021-03-28 15:31:25 -07:00
ridiculousfish
0b06a0ee07 Further refactoring of builtin_set
This rearranges some error handling to centralize it, and performs
additional cleanup.
2021-03-28 15:31:25 -07:00
ridiculousfish
6c46ea0ed2 Refactor builtin_set
This cleans up builtin_set a bit, with the meat of the change being
reworking `parse_index` into `split_var_and_indexes`.

`parse_index` was a function that split a string like `foo[1 3..5]` into
its variable name `foo` and the indexes (here `1 3 4 5`). It had a funny
interface where it would modify a C string in-place. Switch it to return a
`split_var_t` which is a little struct wrapping up the split operation.
This simplifies memory management, and also avoids modifying the arguments
to the builtin.
2021-03-28 15:31:25 -07:00
ridiculousfish
abc66511f5 Simplify main thread requests
This replaces the main_thread_request struct with just a simple
function.
2021-03-28 15:31:25 -07:00
ridiculousfish
05d8907071 Remove the completion form of iothread_perform
Previously iothread_perform could do something on a background thread, and
then do something on the main thread. But we no longer use that second
part: instead everything goes through debounce. Remove the completion
parameter from iothread_perform.
2021-03-28 15:31:25 -07:00
lapingenieur
a68791fa89 [vi-mode] corrected normal/default mode pasting
In vim p means paste *after* current character, so go forward a char before pasting.
Also in vim, P means paste *at* current position (like at '|' with cursor = line),
so there's no need to go back a char, just paste it without moving.
2021-03-28 13:28:40 -07:00
Ilan Cosman
c762c62464 Add max and min math functions 2021-03-28 13:22:44 -07:00
ridiculousfish
a5ea8570ae Properly syntax highlight commands that get entered too fast
This fixes the following problem: if a command is entered while the
previous command is still executing, fish will see it all at once and
execute it before syntax highlighting as a chance to start. So the
command will appear wrong on the terminal. Fix this by detecting this
case and performing a fast no-io highlight.

An example of how to reproduce this:
run `sleep 3` and then type `echo foo` while the sleep is still running.
2021-03-28 12:52:59 -07:00
Fabian Homborg
4e4852c40a history: Improve bash import check
- Check for special characters *before* attempting to parse
- Also ignore lines with `{` and `*`
- Also skip lines with `<<` because that might be a heredoc (or a
- `<<<` herestring)

Fixes #7874.
2021-03-28 20:30:37 +02:00
Fabian Homborg
e7abb52526 Remove special "default" value for $fish_history
This is really of very little use and makes checking $fish_history
harder because it makes two values mean the same thing.

Fixes #7650
2021-03-28 12:09:58 +02:00
David Adam
3f08fb9f9e Revert "README: note dependency on tput"
This reverts commit 50398ea9f5.

tput is only required as a fallback for backward compatibility.
2021-03-28 16:15:32 +08:00
David Adam
2a22a2e4e4 Revert "fish.spec: add SUSE depends on ncurses-utils eg tput"
This reverts commit b5823ac5e1.

tput is only required as a fallback for backward compatibility.
2021-03-28 16:15:32 +08:00
ridiculousfish
b44f40547b Rationalize exit codes for failed execs
This cleans up some exit code processing. Previously a failed exec
would produce exit code 125 unconditionally, while a failed posix_spawn
would produce exit code 1 (!).

With this change, fish reports exit code 126 for not-executable, and 127
for file-not-found. This matches bash.
2021-03-27 21:37:46 -07:00
ridiculousfish
694e112a9b Do not implicitly pass .fish files to /bin/sh
This expands the heuristic introduced in #7802 to prevent implicitly
passing files ending in .fish to /bin/sh.
2021-03-27 19:17:18 -07:00
ridiculousfish
eb71e4555f Clean up and relnote shebangless script support
This adds a test for shebangless support from #7802, cleans up some of
its tricks, and includes it in the changelog.
2021-03-27 16:08:42 -07:00
Justine Tunney
0048730a67 Allow more scripts without #!
This change modifies the fish safety check surrounding execve / spawn so
it can run shell scripts having concatenated binary content. We're using
the same safety check as FreeBSD /bin/sh [1] and the Z-shell [5].  POSIX
was recently revised to require this behavior:

    "The input file may be of any type, but the initial portion of the
     file intended to be parsed according to the shell grammar (XREF to
     XSH 2.10.2 Shell Grammar Rules) shall consist of characters and
     shall not contain the NUL character. The shell shall not enforce
     any line length limits."

    "Earlier versions of this standard required that input files to the
     shell be text files except that line lengths were unlimited.
     However, that was overly restrictive in relation to the fact that
     shells can parse a script without a trailing newline, and in
     relation to a common practice of concatenating a shell script
     ending with an 'exit' or 'exec $command' with a binary data payload
     to form a single-file self-extracting archive." [2] [3]

One example use case of such scripts, is the Cosmopolitan C Library [4]
which configuse the GNU Linker to output a polyglot shell+binary format
that runs on Linux / Mac / Windows / FreeBSD / OpenBSD / NetBSD / BIOS.

Fixes jart/cosmopolitan#88

[1] 9a1cd36331
[2] http://austingroupbugs.net/view.php?id=1250
[3] http://austingroupbugs.net/view.php?id=1226#c4394
[4] https://justine.lol/cosmopolitan/index.html
[5] 326d9c203b
2021-03-27 13:46:11 -07:00
Fabian Homborg
df53d1415d cd first, ask questions later (#7586)
cd: Just try to cd without checking first

Some filesystems are broken and error out on `stat(3)` of existing and
cd-able directories.

So we just try to `fchdir` and report errors later.

Fixes #7577.
2021-03-27 18:28:03 +01:00
David Adam
50398ea9f5 README: note dependency on tput 2021-03-27 23:28:21 +08:00
David Adam
b5823ac5e1 fish.spec: add SUSE depends on ncurses-utils eg tput 2021-03-27 23:11:03 +08:00
Fabian Homborg
93eaa61294 Split up documentation
This breaks apart the massive "index" document into

1. An "index" document that explains how to install and set up fish
and links to the other documents
2. A "fish-language" document that describes the syntax and semantics
of the language
3. A "fish-interactive" document that describes how to use fish
interactively

No change to the content has been made, only the parts have been moved
from index and some of the formatting (links and header levels) were
fixed.

See #7348.
2021-03-27 15:44:17 +01:00
Fabian Homborg
1705bd1440 __fish_man_page: Try man before
This is really just `less` being precious and `man` being unspecified.

Fixes #7863.
2021-03-27 09:15:31 +01:00
Kid
61b94fe093 Fix typo in read completion (#7867) 2021-03-26 20:31:03 +01:00
Fabian Homborg
b9a68e9e86 Update CHANGELOG 2021-03-26 19:32:14 +01:00
Fabian Homborg
fb7c8c4064 __fish_prepend_sudo: First insert history and then *toggle*
Previously this would only ever insert sudo if it took a commandline
from history, not remove it.

So you would end up with

    sudo sudo apt install
2021-03-26 19:32:14 +01:00
Fabian Homborg
3255999794 Bravely set job control to full at startup
We have no idea why this was even a thing. For now simply set it to
"all"/"full" (why these two names? no idea) at startup and allow
changing it later.

Settting it *immediately* when defining the variable sets it too soon
because we don't have the interactive signal handlers
enabled (including the one for SIGTTOU), so let's first settle for
this little piece of awkwardness.

This needs widespread testing, so we merge it early, immediately after
the release.

Fixes #5036
Fixes #5832
Fixes #7721

(and probably numerous others)
2021-03-26 19:32:14 +01:00
Fabian Homborg
75a4e28e4f Manpage generator: Give better error when we can't understand manpath
This would just say "No paths specified", which is *true*, but then we
typically don't give paths, because we figure out the man path.
2021-03-26 19:32:14 +01:00
Fabian Homborg
c8c641dd63 Update littlecheck to 5f6c024fbdf6654e7851d3fd756a6d56e167476e
Now with 52% fewer "command not found" errors
2021-03-26 19:32:14 +01:00
Fabian Homborg
c1fe5be0ce parse_util: Remove locate_cmdsubst
We have *3* functions to find command substitutions, this is the most awkward.
2021-03-26 19:32:14 +01:00
Fabian Homborg
58177ba091 docs: Replace all internal links with :ref:s
Unlike links, these are checked by sphinx and it complains if they
don't match.

Also they have a better chance of doing something useful in outputs
other than html.
2021-03-26 19:32:14 +01:00
Fabian Homborg
8e6cfa1311 docs: Explicity link a few more sections
This makes it easier to move them around.
2021-03-26 19:32:14 +01:00
Fabian Homborg
163f42ac62 tinyexpr: Remove invalid const
We const cast these, so they aren't actually const,
and const doesn't actually help with optimization or anything (because const_cast exists),
so I would rather remove this, because const_cast gives me both the heebies and the jeebies.
2021-03-26 19:30:38 +01:00
Fabian Homborg
cbd8f5f63e math: Add log2
This was already in the documentation as an example, now it is
actually working.

Fixes #7734
2021-03-26 19:30:38 +01:00
Johannes Altmanninger
dc417f58ae completions/aura: remove outdated flag
Commit a0b46e620 ("Update Aura completions") removed "abs", but forgot
it here.

Fixes #7865
2021-03-26 07:49:05 +01:00
Johannes Altmanninger
4f00ccfd16 Disable flaky tmux test on GitHub Actions
It still failed with the long timeout. No idea why.
2021-03-26 07:36:55 +01:00
Michael Jarvis
cd1f0cc5d5 Add a placeholder to last section of CHANGELOG.rst
This placeholder silences a warning, and allows the horizontal
line between releases to be retained.
2021-03-25 07:34:20 +08:00
Michael Jarvis
620344b076 Fix Sphinx warning
When regenerating documentation with Sphinx, there's a warning issued about CHANGELOG.rst:

```
../CHANGELOG.rst:33: WARNING: Document or section may not begin with a transition.
```

This is almost identical to the fix in commit 84a89f5195.
2021-03-25 07:34:20 +08:00
Ilan Cosman
bcbfd70d41 Create empty directories and files on interactive startup (#7796)
Closes #7402
2021-03-23 21:01:00 +01:00
Johannes Altmanninger
76af09a507 Give tmux tests more slack
They never fail me locally, but I saw two failures in GitHub Actions
in the past days (regular builds, not just TSan).
2021-03-23 20:54:23 +01:00
Karolina Gontarek
a0f05b376e Shorten completions for vbc and pydf (#7859) 2021-03-23 20:46:42 +01:00
Jannik Vieten
0f3274d5eb Fix completion errors for tshark when running as root (#7858) 2021-03-23 20:40:44 +01:00
Mahmoud Al-Qudsi
c55865f76e Change use of tmux's resize-window to resize-pane
I believe they are both equivalent for our particular purpose, since we
only care about enforcing the size fish sees.

`resize-window` was only introduced in tmux 2.9, which isn't available
at least on Ubuntu 18.04 LTS (currently using tmux 2.6) and probably
many others.

(Clever idea to use tmux here!)
2021-03-23 00:39:17 -05:00
Fabian Homborg
7f7cfcf339 Only donate term if we're interactive *and* have the terminal
As it turns out otherwise fish would hang when sddm starts it as the login shell.

Belongs to #7842.
2021-03-22 17:00:43 +01:00
ridiculousfish
66a873ad23 Relnote fix for 7837 2021-03-21 16:59:22 -07:00
ridiculousfish
8d54d2b60e Skip long arguments in syntax highlighting path detection
When fish performs syntax highlighting, it attempts to determine which
arguments are valid paths and underline them. Skip paths whose length
exceeds PATH_MAX. This is an optimization: such strings are almost
certainly not valid paths and checking them may be expensive.

Relevant is #7837
2021-03-21 16:59:22 -07:00
ridiculousfish
cf35431af9 Reimplement wbasename and wdirname
Previously wbasename and wdirname wrapped the system-provided basename
and dirname. But these have thread-safety issues and some surprising
error conditions on Mac. Just reimplement these per the OpenGroup spec.

In particular these no longer trigger a null-dereference if the input
exceeds PATH_MAX.

Add some tests too.

This fixes #7837
2021-03-21 16:33:04 -07:00
ridiculousfish
6e1b324343 Add some tests for dirname and basename
This is in preparation for replacing our wrappers around the C versions,
with custom versions instead.
2021-03-21 16:32:58 -07:00
ridiculousfish
a7c37e4af4 Don't block certain error signals on background threads
Previously fish attempted to block all signals on background threads, so
that they would be delivered to the main thread. But on Mac, SIGSEGV
and probably some others just get silently dropped, leading to potential
infinite loops instead of crashing. So stop blocking these signals.

With this change the null-deref in #7837 will properly crash instead of
spinning.
2021-03-21 16:32:45 -07:00
ridiculousfish
43cc99e1ba Group certain cmake targets into folders
This makes folders in IDEs for certain Mac and gettext targets, reducing
the number of targets which appear at top-level.
2021-03-21 13:29:41 -07:00
ridiculousfish
1b950f5f3b Switch fish.pc dependency from FBVF file to CHECK-FBVF target
Previously, both fish.pc and libfish had generating the
FISH-BUILD-VERSION-FILE attached as a command. In principle they could
both try to run the command simultaneously and now CMake complains about
this with the Xcode generator.

Switch to having fish.pc depend on the CHECK-FISH-BUILD-VERSION-FILE as a
target instead of a command. This allows it to participate in dependency
resolution and CMake will succeed again.

Fixes #7838
2021-03-21 12:39:24 -07:00
Johannes Altmanninger
206543c55b fixup! Pass some parameters by reference/move 2021-03-21 19:46:49 +01:00
Johannes Altmanninger
508044bce1 Pass some parameters by reference/move 2021-03-21 19:41:36 +01:00
Johannes Altmanninger
516a70d9cb Misc cleanups
Some as suggested by lgtm.com
2021-03-21 19:41:36 +01:00
Fabian Homborg
1018cb2a81 echo: Buffer output and write it in one go
`streams.out.push_back` for fd_streams_t writes to the
fd *immediately*. We might want to introduce a general buffering
strategy, but in this case writing it in one go is the simplest and
seems acceptable - we already have constrained the argument size, so
just pushing it out should work well enough.

See #7836
2021-03-21 17:49:22 +01:00
Fabian Homborg
e4fd664bbb Only set modes after config.fish if we're *interactive*
013a563ed0 made it so we only try to
adjust terminal modes if we are in the terminal pgroup, but that's not
enough.

Fish starts background jobs in events inside its own pgroup, so

    function on-foo --on-event foo
        fish -c 'sleep 3' &
    end

would have the backgrounded fish try to fiddle with the terminal and
succeed.

Instead, only fiddle with the terminal if we're interactive (this
should probably be extended to other bits, but this is the particular
problematic part)

Fixes #7842.
2021-03-21 10:43:47 +01:00
Fabian Homborg
95dc821a44 Disable pacman command-not-found handler
Apparently it's too slow on some systems

Fixes #7841.
2021-03-21 10:03:53 +01:00
Fabian Homborg
56135a3231 Test string replace transforms
Just to make sure it works everywhere.
2021-03-21 10:03:35 +01:00
Karolina Gontarek
e4eaca1032 Fix wrapping for cd (#7843) 2021-03-21 09:27:19 +01:00
Karolina Gontarek
dcc1659266 Fix typo 2021-03-21 09:26:38 +01:00
Johannes Altmanninger
7fea321b3e Use the correct case in completion pager (#7744)
Consider

	$ complete -c foo -a 'aab aaB' -f
	$ foo A<TAB>

since 28d67c8 we would insert the common prefix AND show the pager.
Due to case-insensitive comparison, "b/B" was considered to be part
of the prefix. Since the prefix is added to each pager item [1]
we get wrong results. Fix this by removing the insensitive comparison
between completions - I don't think it was of much use anyway.
Commandline tokens are still matched case-insensitively, this is
just about completions.

Test this by running interactive fish inside tmux (pexpect's terminal
emulation not have enough capabilities).  Also add tests for recent
interactive regressions #7526 and #7738.

Closes #3978

[1]: b38a23a would solve this differently by giving every pager item
its own prefix, but was reverted since it needs more fixes.
2021-03-21 09:25:29 +01:00
Olivier FAURE
211f8bc894 Write new completion file for cargo (#7839) 2021-03-20 21:44:38 +01:00
exploide
5eadee61c5 improved SSH completions
- use __fish_complete_ssh also for sftp
- removed old options -1 and -2
- added several newer options
- cleaned up and sorted completion code
2021-03-20 21:17:53 +01:00
Fabian Homborg
d79f864072 Add a note for help thing to the missing doc error message
This should cover most cases - the user didn't install the docs and is
trying to view the man page via __fish_print_help, so we don't have a
way to show anything.

But `help thing` will fall back to the online version of the docs,
which should work if there's an internet connection.

See #7824.
2021-03-19 17:39:36 +01:00
Fabian Homborg
02699d1acc Reject empty variable names
This allowed `set "" foo`, which is bogus and results in an unusable variable.
2021-03-18 19:36:57 +01:00
David Adam
c2eef7c250 CHANGELOG: add separator (minor formatting fix) 2021-03-18 12:36:48 +08:00
David Adam
7b53547dcd .desktop file: drop deprecated key
Recommended by @ZanderBrown in
eb7172458b (commitcomment-48302972)
2021-03-18 12:36:18 +08:00
David Adam
23f613723f Merge branch 'Integration_3.2.1' 2021-03-18 12:23:06 +08:00
323 changed files with 9540 additions and 6127 deletions

View File

@@ -7,7 +7,7 @@ packages:
- gmake
- pcre2
- python
- py37-pexpect
- py38-pexpect
sources:
- https://git.sr.ht/~faho/fish
tasks:

View File

@@ -1,10 +1,6 @@
name: C/C++ CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
on: [push, pull_request]
jobs:
ubuntu:
@@ -15,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install deps
run: |
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
sudo pip3 install pexpect
- name: cmake
env:
@@ -40,7 +36,7 @@ jobs:
- name: Install deps
run: |
sudo apt update
sudo apt install gettext lib32ncurses5-dev python3-pip g++-multilib
sudo apt install gettext lib32ncurses5-dev python3-pip g++-multilib tmux
sudo pip3 install pexpect
- name: cmake
env:
@@ -48,7 +44,7 @@ jobs:
CFLAGS: "-m32"
run: |
mkdir build && cd build
cmake ..
cmake -DFISH_USE_SYSTEM_PCRE2=OFF ..
- name: make
run: |
make
@@ -64,7 +60,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install deps
run: |
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
sudo pip3 install pexpect
- name: cmake
env:
@@ -72,7 +68,7 @@ jobs:
CXX: clang++
CXXFLAGS: "-fno-omit-frame-pointer -fsanitize=undefined -fsanitize=address"
ASAN_OPTIONS: check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1
UBSAN_OPTIONS: print_stacktrace=1:report_error_type=1:suppressions=$TRAVIS_BUILD_DIR/build_tools/ubsan.blacklist
UBSAN_OPTIONS: print_stacktrace=1:report_error_type=1
run: |
mkdir build && cd build
cmake ..
@@ -91,7 +87,7 @@ jobs:
- uses: actions/checkout@v2
- name: Install deps
run: |
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
sudo pip3 install pexpect
- name: cmake
env:
@@ -117,6 +113,7 @@ jobs:
- name: Install deps
run: |
sudo pip3 install pexpect
brew install tmux
- name: cmake
run: |
mkdir build && cd build

View File

@@ -1,3 +1,114 @@
fish 3.3.0 (released June 28, 2021)
===================================
Notable improvements and fixes
------------------------------
- ``fish_config`` gained a ``prompt`` subcommand to show and pick from the sample prompts directly in the terminal, instead of having to open a webbrowser. For example ``fish_config prompt choose default`` loads the default prompt in the current session (:issue:`7958`).
- The documentation has been reorganized to be easier to understand (:issue:`7773`).
Deprecations and removed features
---------------------------------
- The ``$fish_history`` value "default" is no longer special. It used to be treated the same as "fish" (:issue:`7650`).
- Redirection to standard error with the ``^`` character has been disabled by default. It can be turned back on using the ``stderr-nocaret`` feature flag, but will eventually be disabled completely (:issue:`7105`).
- Specifying an initial tab to ``fish_config`` now only works with ``fish_config browse`` (e.g. ``fish_config browse variables``), otherwise it would interfere with the new ``prompt`` subcommand (see below) (:issue:`7958`).
Scripting improvements
----------------------
- ``math`` gained new functions ``log2`` (like the documentation claimed), ``max`` and ``min`` (:issue:`7856`). ``math`` functions can be used without the parentheses (eg ``math sin 2 + 6``), and functions have the lowest precedence in the order of operations (:issue:`7877`).
- Shebang (``#!``) lines are no longer required within shell scripts, improving support for scripts with concatenated binary contents. If a file fails to execute and passes a (rudimentary) binary safety check, fish will re-invoke it using ``/bin/sh`` (:issue:`7802`).
- Exit codes are better aligned with bash. A failed execution now reports ``$status`` of 127 if the file is not found, and 126 if it is not executable.
- ``echo`` no longer writes its output one byte at a time, improving performance and allowing use with Linux's special API files (``/proc``, ``/sys`` and such) (:issue:`7836`).
- fish should now better handle ``cd`` on filesystems with broken ``stat(3)`` responses (:issue:`7577`).
- Builtins now properly report a ``$status`` of 1 upon unsuccessful writes (:issue:`7857`).
- ``string match`` with unmatched capture groups and without the ``--all`` flag now sets an empty variable instead of a variable containing the empty string. It also correctly imports the first match if multiple arguments are provided, matching the documentation. (:issue:`7938`).
- fish produces more specific errors when a command in a command substitution wasn't found or is not allowed. This now prints something like "Unknown command" instead of "Unknown error while evaluating command substitution".
- ``fish_indent`` allows inline variable assignments (``FOO=BAR command``) to use line continuation, instead of joining them into one line (:issue:`7955`).
- fish gained a ``--no-config`` option to disable configuration files. This applies to user-specific and the systemwide ``config.fish`` (typically in ``/etc/fish/config.fish``), and configuration snippets (typically in ``conf.d`` directories). It also disables universal variables, history, and loading of functions from system or user configuration directories (:issue:`7921`, :issue:`1256`).
- When universal variables are unavailable for some reason, setting a universal variable now sets a global variable instead (:issue:`7921`).
- ``$last_pid`` now contains the process ID of the last process in the pipeline, allowing it to be used in scripts (:issue:`5036`, :issue:`5832`, :issue:`7721`). Previously, this value contained the process group ID, but in scripts this was the same as the running fish's process ID.
- ``process-exit`` event handlers now receive the same value as ``$status`` in all cases, instead of receiving -1 when the exit was due to a signal.
- ``process-exit`` event handlers for PID 0 also received ``JOB_EXIT`` events; this has been fixed.
- ``job-exit`` event handlers may now be created with any of the PIDs from the job. The handler is passed the last PID in the job as its second argument, instead of the process group.
- Trying to set an empty variable name with ``set`` no longer works (these variables could not be used in expansions anyway).
- ``fish_add_path`` handles an undefined ``PATH`` environment variable correctly (:issue:`8082`).
Interactive improvements
-------------------------
- Commands entered before the previous command finishes will now be properly syntax highlighted.
- fish now automatically creates ``config.fish`` and the configuration directories in ``$XDG_CONFIG_HOME/fish`` (by default ``~/.config/fish``) if they do not already exist (:issue:`7402`).
- ``$SHLVL`` is no longer incremented in non-interactive shells. This means it won't be set to values larger than 1 just because your environment happens to run some scripts in $SHELL in its startup path (:issue:`7864`).
- fish no longer rings the bell when flashing the command line. The flashing should already be enough notification and the bell can be annoying (:issue:`7875`).
- ``fish --help`` is more helpful if the documentation isn't installed (:issue:`7824`).
- ``funced`` won't include an entry on where a function is defined, thanks to the new ``functions --no-details`` option (:issue:`7879`).
- A new variable, ``fish_killring``, containing entries from the killring, is now available (:issue:`7445`).
- ``fish --private`` prints a note on private mode on startup even if ``$fish_greeting`` is an empty list (:issue:`7974`).
- fish no longer attempts to lock history or universal variable files on remote filesystems, including NFS and Samba mounts. In rare cases, updates to these files may be dropped if separate fish instances modify them simultaneously. (:issue:`7968`).
- ``wait`` and ``on-process-exit`` work correctly with jobs that have already exited (:issue:`7210`).
- ``__fish_print_help`` (used for ``--help`` output for fish's builtins) now respects the ``LESS`` environment variable, and if not set, uses better default pager settings (:issue:`7997`).
- Errors from ``alias`` are now printed to standard error, matching other builtins and functions (:issue:`7925`).
- ``ls`` output is colorized on OpenBSD if colorls utility is installed (:issue:`8035`)
- The default pager color looks better in terminals with light backgrounds (:issue:`3412`).
- Further robustness improvements to the bash history import (:issue:`7874`).
- fish now tries to find a Unicode-aware locale for encoding (``LC_CTYPE``) if started without any locale information, improving the display of emoji and other non-ASCII text on misconfigured systems (:issue:`8031`). To allow a C locale, set the variable ``fish_allow_singlebyte_locale`` to 1.
- The Web-based configuration and documentation now feature a dark mode if the browser requests it (:issue:`8043`).
- Color variables can now also be given like ``--background red`` and ``-b red``, not just ``--background=red`` (:issue:`8053`).
- ``exit`` run within ``fish_prompt`` now exits properly (:issue:`8033`).
- When attempting to execute the unsupported POSIX-style brace command group (``{ ... }``) fish will suggest its equivalent ``begin; ...; end`` commands (:issue:`6415`).
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^
- Pasting in Vi mode puts text in the right place in normal mode (:issue:`7847`).
- Vi mode's :kbd:`u` is bound to ``undo`` instead of ``history-search-backward``, following GNU readline's behavior. Similarly, :kbd:`Control-R` is bound to ``redo`` instead of ``history-search-backward``, following Vim (:issue:`7908`).
- :kbd:`s` in Vi visual mode now does the same thing as :kbd:`c` (:issue:`8039`).
- The binding for :kbd:`"*y` now uses ``fish_clipboard_copy``, allowing it to support more than just ``xsel``.
- The :kbd:`Control-Space` binding can be correctly customised (:issue:`7922`).
- ``exit`` works correctly in bindings (:issue:`7967`).
- The :kbd:`F1` binding, which opens the manual page for the current command, now works around a bug in certain ``less`` versions that fail to clear the screen (:issue:`7863`).
- The binding for :kbd:`Alt-S` now toggles whether ``sudo`` is prepended, even when it took the commandline from history instead of only adding it.
- The new functions ``fish_commandline_prepend`` and ``fish_commandline_append`` allow toggling the presence of a prefix/suffix on the current commandline. (:issue:`7905`).
- ``backward-kill-path-component`` :kbd:`Control-W`) no longer erases parts of two tokens when the cursor is positioned immediately after ``/``. (:issue:`6258`).
Improved prompts
^^^^^^^^^^^^^^^^
- The default Vi mode prompt now uses foreground instead of background colors, making it less obtrusive (:issue:`7880`).
- Performance of the "informative" git prompt is improved somewhat (:issue:`7871`). This is still slower than the non-informative version by its very nature. In particular it is IO-bound, so it will be very slow on slow disks or network mounts.
- The sample prompts were updated. Some duplicated prompts, like the various classic variants, or less useful ones, like the "justadollar" prompt were removed, some prompts were cleaned up, and in some cases renamed. A new "simple" and "disco" prompt were added (:issue:`7884`, :issue:`7897`, :issue:`7930`). The new prompts will only take effect when selected and existing installed prompts will remain unchanged.
- A new ``prompt_login`` helper function to describe the kind of "login" (user, host and chroot status) for use in prompts. This replaces the old "debian chroot" prompt and has been added to the default and terlar prompts (:issue:`7932`).
- The Web-based configuration's prompt picker now shows and installs right prompts (:issue:`7930`).
- The git prompt now has the same symbol order in normal and "informative" mode, and it's customizable via ``$__fish_git_prompt_status_order`` (:issue:`7926`).
Completions
^^^^^^^^^^^
- Added completions for:
- ``firewall-cmd`` (:issue:`7900`)
- ``sv`` (:issue:`8069`)
- Improvements to plenty of completions!
- Commands that wrap ``cd`` (using ``complete --wraps cd``) get the same completions as ``cd`` (:issue:`4693`).
- The ``--force-files`` option to ``complete`` works for bare arguments, not just options (:issue:`7920`).
- Completion descriptions for functions don't include the function definition, making them more concise (:issue:`7911`).
- The ``kill`` completions no longer error on MSYS2 (:issue:`8046`).
- Completion scripts are now loaded when calling a command via a relative path (like ``./git``) (:issue:`6001`, :issue:`7992`).
- When there are multiple completion candidates, fish inserts their shared prefix. This prefix was computed in a case-insensitive way, resulting in wrong case in the completion pager. This was fixed by only inserting prefixes with matching case (:issue:`7744`).
Improved terminal support
^^^^^^^^^^^^^^^^^^^^^^^^^
- fish no longer tries to detect a missing new line during startup, preventing an erroneous ```` from appearing if the terminal is resized at the wrong time, which can happen in tiling window managers (:issue:`7893`).
- fish behaves better when it disagrees with the terminal on the width of characters. In particular, staircase effects with right prompts should be gone in most cases (:issue:`8011`).
- If the prompt takes up the entire line, the last character should no longer be chopped off in certain terminals (:issue:`8002`).
- fish's reflow handling has been disabled by default for kitty (:issue:`7961`).
- The default prompt no longer produces errors when used with a dumb terminal (:issue:`7904`).
- Terminal size variables are updated for window size change signal handlers (``SIGWINCH``).
- Pasting within a multi-line command using a terminal that supports bracketed paste works correctly, instead of producing an error (:issue:`7782`).
- ``set_color`` produces an error when used with invalid arguments, rather than empty output which interacts badly with Cartesian product expansion.
For distributors
----------------
- fish runs correctly on platforms without the ``O_CLOEXEC`` flag for ``open(2)`` (:issue:`8023`).
--------------
fish 3.2.2 (released April 7, 2021)
====================================
@@ -189,7 +300,7 @@ Scripting improvements
- ``fish --profile`` now only starts profiling after fish is ready to execute commands (all configuration is completed). There is a new ``--profile-startup`` option that only profiles the startup and configuration process (:issue:`7648`).
- Builtins return a maximum exit status of 255, rather than potentially overflowing. In particular, this affects ``exit``, ``return``, ``functions --query``, and ``set --query`` (:issue:`7698`, :issue:`7702`).
- It is no longer an error to run builtin with closed stdin. For example ``count <&-`` now prints 0, instead of failing.
- Blocks, functions, and builtins no longer permit redirecting to file descriptors other than 0 (standard input), 1 (standard output) and 2 (standard error). For example, ``echo hello >&5`` is now an error. This prevents corruption of internal state (#3303).
- Blocks, functions, and builtins no longer permit redirecting to file descriptors other than 0 (standard input), 1 (standard output) and 2 (standard error). For example, ``echo hello >&5`` is now an error. This prevents corruption of internal state (:issue:`3303`).
Interactive improvements
------------------------

View File

@@ -30,6 +30,11 @@ if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}")
endif()
# Error out when linking statically, it doesn't work.
if (CMAKE_EXE_LINKER_FLAGS MATCHES ".*-static.*")
message(FATAL_ERROR "Fish does not support static linking")
endif()
# Force colored warnings in Ninja's output, if the compiler has -fdiagnostics-color support.
# Rationale in https://github.com/ninja-build/ninja/issues/814
if (CMAKE_GENERATOR STREQUAL "Ninja" AND
@@ -123,7 +128,8 @@ set(FISH_SRCS
src/proc.cpp src/reader.cpp src/redirection.cpp src/sanity.cpp src/screen.cpp
src/signal.cpp src/termsize.cpp src/timer.cpp src/tinyexpr.cpp
src/tokenizer.cpp src/topic_monitor.cpp src/trace.cpp src/utf8.cpp src/util.cpp
src/wcstringutil.cpp src/wgetopt.cpp src/wildcard.cpp src/wutil.cpp src/fds.cpp
src/wait_handle.cpp src/wcstringutil.cpp src/wgetopt.cpp src/wildcard.cpp
src/wutil.cpp src/fds.cpp
)
# Header files are just globbed.

View File

@@ -1,7 +1,7 @@
Fish is a smart and user-friendly command line shell.
Copyright (C) 2005-2009 Axel Liljencrantz
Copyright (C) 2009-2020 fish-shell contributors
Copyright (C) 2009-2021 fish-shell contributors
fish is free software.

View File

@@ -20,11 +20,6 @@ magic phrase “unlike other shells”.
Detailed user documentation is available by running ``help`` within
fish, and also at https://fishshell.com/docs/current/index.html
You can quickly play with fish right in your browser by clicking the
button below:
|Try in browser|
Getting fish
------------
@@ -76,7 +71,7 @@ If packages are not available for your platform, GPG-signed tarballs are
available from `fishshell.com <https://fishshell.com/>`__ and
`fish-shell on
GitHub <https://github.com/fish-shell/fish-shell/releases>`__. See the
*Building* section for instructions.
`Building <#building>`__ section for instructions.
Running fish
------------
@@ -109,6 +104,7 @@ The following optional features also have specific requirements:
``wl-copy``/``wl-paste`` or ``pbcopy``/``pbpaste`` utilities
- full completions for ``yarn`` and ``npm`` require the
``all-the-package-names`` NPM module
- ``colorls`` is used, if its installed, to add color when running ``ls``
Switching to fish
~~~~~~~~~~~~~~~~~
@@ -192,6 +188,19 @@ You can open it with Xcode, or run the following to build and install in
The install directory can be changed using the
``-DCMAKE_INSTALL_PREFIX`` parameter for ``cmake``.
Build options
~~~~~~~~~~~~~
In addition to the normal cmake build options (like ``CMAKE_INSTALL_PREFIX``), fish has some other options available to customize it.
- BUILD_DOCS=ON|OFF - whether to build the documentation. This is automatically set to OFF when sphinx isn't installed.
- INSTALL_DOCS=ON|OFF - whether to install the docs. This is automatically set to on when BUILD_DOCS is or prebuilt documentation is available (like when building in-tree from a tarball).
- FISH_USE_SYSTEM_PCRE2=ON|OFF - whether to use an installed pcre2. This is normally autodetected.
- MAC_CODESIGN_ID=String|OFF - the codesign ID to use on Mac, or "OFF" to disable codesigning.
- WITH_GETTEXT=ON|OFF - whether to build with gettext support for translations.
Note that fish does *not* support static linking and will attempt to error out if it detects it.
Help, it didnt build!
~~~~~~~~~~~~~~~~~~~~~~
@@ -233,5 +242,3 @@ issue <https://github.com/fish-shell/fish-shell/issues/new>`__.
.. |Build Status| image:: https://github.com/fish-shell/fish-shell/workflows/C/C++%20CI/badge.svg
:target: https://github.com/fish-shell/fish-shell/actions
.. |Try in browser| image:: https://cdn.rawgit.com/rootnroll/library/assets/try.svg
:target: https://rootnroll.com/d/fish-shell/

View File

@@ -35,6 +35,19 @@ CHECK_STDERR_RE = re.compile(COMMENT_RE + r"CHECKERR:\s+(.*)\n")
SKIP = object()
def find_command(program):
import os
path, name = os.path.split(program)
if path:
return os.path.isfile(program) and os.access(program, os.X_OK)
for path in os.environ["PATH"].split(os.pathsep):
exe = os.path.join(path, program)
if os.path.isfile(exe) and os.access(exe, os.X_OK):
return exe
return None
class Config(object):
def __init__(self):
# Whether to have verbose output.
@@ -461,18 +474,15 @@ class TestRun(object):
proc = runproc(self.subbed_command)
stdout, stderr = proc.communicate()
# HACK: This is quite cheesy: POSIX specifies that sh should return 127 for a missing command.
# Technically it's also possible to return it in other conditions.
# Practically, that's *probably* not going to happen.
# It's also possible that it'll be returned in other situations,
# most likely when the last command in a shell script doesn't exist.
# So we check if the command *we execute* exists, and complain then.
status = proc.returncode
if status == 127:
raise CheckerError("Command could not be found: " + self.subbed_command)
if status == 126:
raise CheckerError("Command is not executable: " + self.subbed_command)
# If a test returns 125, we skip it and don't even attempt to compare output.
# This is similar to what `git bisect run` does.
if status == 125:
return SKIP
cmd = shlex.split(self.subbed_command)[0]
if status == 127 and not find_command(cmd):
raise CheckerError("Command could not be found: " + cmd)
if status == 126 and not find_command(cmd):
raise CheckerError("Command is not executable: " + cmd)
outlines = [
Line(text, idx + 1, "stdout")
@@ -587,7 +597,10 @@ class Checker(object):
# If no RUN command has been given, fall back to the shebang.
if lines[0].text.startswith("#!"):
# Remove the "#!" at the beginning, and the newline at the end.
self.runcmds = [RunCmd(lines[0].text[2:-1] + " %s", lines[0])]
cmd = lines[0].text[2:-1]
if not find_command(cmd):
raise CheckerError("Command could not be found: " + cmd)
self.runcmds = [RunCmd(cmd + " %s", lines[0])]
else:
raise CheckerError("No runlines ('# RUN') found")

View File

@@ -141,7 +141,7 @@ class SpawnedProc(object):
env: a string->string dictionary, describing the environment variables.
"""
if name not in env:
raise ValueError("'name' variable not found in environment" % name)
raise ValueError("'%s' variable not found in environment" % name)
exe_path = env.get(name)
self.colorize = sys.stdout.isatty()
self.messages = []
@@ -291,7 +291,6 @@ class SpawnedProc(object):
else:
timestampstr = "{timestamp:10.2f} ms".format(timestamp=timestamp)
delta = m.when * 1000.0
dir = m.dir
print(
"{dir} {timestampstr} (Line {lineno}): {BOLD}{etext}{RESET}".format(
dir=m.dir,

View File

@@ -1,3 +0,0 @@
# Ubuntu Xenial (used for Travis CI builds) ships libstdc++ 5.4.0 which contains undefined behaviour
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63345
object-size:*bits/stl_tree.h

View File

@@ -56,9 +56,9 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
endif()
if(_lang STREQUAL "C")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.c)
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.c)
elseif(_lang STREQUAL "CXX")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${var}.cpp)
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckIncludeFiles/${VARIABLE}.cpp)
else()
message(FATAL_ERROR "Unknown language:\n ${_lang}\nSupported languages: C, CXX.\n")
endif()

View File

@@ -73,3 +73,6 @@ add_custom_target(signed_fish_macapp
$<TARGET_BUNDLE_DIR:fish_macapp>
VERBATIM
)
# Group our targets in a folder.
set_property(TARGET fish_macapp signed_fish_macapp PROPERTY FOLDER macapp)

View File

@@ -83,9 +83,10 @@ add_custom_target(test_prep
# So define both a normal target, and a serial variant which enforces ordering.
foreach(TESTTYPE test serial_test)
add_custom_target(${TESTTYPE}_low_level
COMMAND env XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_data
COMMAND env XDG_DATA_DIRS=
XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_data
XDG_CONFIG_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_config
XDG_RUNTIME_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_runtime
XDG_RUNTIME_DIR=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_runtime
./fish_tests
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS fish_tests
@@ -94,18 +95,20 @@ foreach(TESTTYPE test serial_test)
add_custom_target(${TESTTYPE}_fishscript
COMMAND
cd tests &&
env XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_data
env XDG_DATA_DIRS=
XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_data
XDG_CONFIG_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_config
XDG_RUNTIME_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_runtime
XDG_RUNTIME_DIR=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_runtime
${TEST_ROOT_DIR}/bin/fish test.fish
DEPENDS test_prep
USES_TERMINAL)
add_custom_target(${TESTTYPE}_interactive
COMMAND cd tests &&
env XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_data
env XDG_DATA_DIRS=
XDG_DATA_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_data
XDG_CONFIG_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_config
XDG_RUNTIME_HOME=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_runtime
XDG_RUNTIME_DIR=${CMAKE_CURRENT_BINARY_DIR}/test/xdg_runtime
${TEST_ROOT_DIR}/bin/fish interactive.fish
DEPENDS test_prep
USES_TERMINAL)

View File

@@ -15,12 +15,15 @@ add_feature_info(gettext GETTEXT_FOUND "translate messages with gettext")
# Define translations
if(GETTEXT_FOUND)
# Group pofile targets into their own folder, as there's a lot of them.
set(CMAKE_FOLDER pofiles)
foreach(lang ${languages})
# Our translations aren't set up entirely as CMake expects, so installation is done in
# cmake/Install.cmake instead of using INSTALL_DESTINATION
gettext_process_po_files(${lang} ALL
PO_FILES po/${lang}.po)
endforeach()
set(CMAKE_FOLDER)
endif()
cmake_push_check_state()

View File

@@ -51,3 +51,10 @@ The following code will create ``rmi``, which runs ``rm`` with additional argume
# will be seen as an argument to "/Applications/Google":
alias chrome='/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome banana'
See more
--------
1. The :ref:`function <cmd-function>` builtin this builds on.
2. :ref:`Functions <syntax-function>`.
3. :ref:`Function wrappers <syntax-function-wrappers>`.

View File

@@ -14,9 +14,9 @@ Synopsis
Description
-----------
This command makes it easy for fish scripts and functions to handle arguments like how fish builtin commands handle their arguments. You pass arguments that define the known options, followed by a literal ``--``, then the arguments to be parsed (which might also include a literal ``--``). ``argparse`` then sets variables to indicate the passed options with their values, and sets $argv (and always $argv) to the remaining arguments. More on this in the `usage <#usage>`__ section below.
This command makes it easy for fish scripts and functions to handle arguments like how fish builtin commands handle their arguments. You pass arguments that define the known options, followed by a literal ``--``, then the arguments to be parsed (which might also include a literal ``--``). ``argparse`` then sets variables to indicate the passed options with their values, and sets $argv (and always $argv) to the remaining arguments. More on this in the :ref:`usage <cmd-argparse-usage>` section below.
Each option specification (``OPTION_SPEC``) is written in the `domain specific language <#option-specifications>`__ described below. All OPTION_SPECs must appear after any argparse flags and before the ``--`` that separates them from the arguments to be parsed.
Each option specification (``OPTION_SPEC``) is written in the :ref:`domain specific language <cmd-argparse-option-specification>` described below. All OPTION_SPECs must appear after any argparse flags and before the ``--`` that separates them from the arguments to be parsed.
Each option that is seen in the ARG list will result in variables named ``_flag_X``, where ``X`` is the short flag letter and the long flag name (if they are defined). For example a ``--help`` option could cause argparse to define one variable called ``_flag_h`` and another called ``_flag_help``.
@@ -41,6 +41,8 @@ The following ``argparse`` options are available. They must appear before all OP
- ``-h`` or ``--help`` displays help about using this command.
.. _cmd-argparse-usage:
Usage
-----
@@ -69,6 +71,8 @@ But this is not::
The first ``--`` seen is what allows the ``argparse`` command to reliably separate the option specifications and options to ``argparse`` itself (like ``--ignore-unknown``) from the command arguments, so it is required.
.. _cmd-argparse-option-specification:
Option Specifications
---------------------

View File

@@ -39,7 +39,7 @@ Note that special input functions cannot be combined with ordinary shell script
If no ``SEQUENCE`` is provided, all bindings (or just the bindings in the given ``MODE``) are printed. If ``SEQUENCE`` is provided but no ``COMMAND``, just the binding matching that sequence is printed.
To save custom keybindings, put the ``bind`` statements into :ref:`config.fish <initialization>`. Alternatively, fish also automatically executes a function called ``fish_user_key_bindings`` if it exists.
To save custom keybindings, put the ``bind`` statements into :ref:`config.fish <configuration>`. Alternatively, fish also automatically executes a function called ``fish_user_key_bindings`` if it exists.
Key bindings may use "modes", which mimics Vi's modal input behavior. The default mode is "default", and every bind applies to a single mode. The mode can be viewed/changed with the ``$fish_bind_mode`` variable.
@@ -185,6 +185,10 @@ The following special input functions are available:
- ``transpose-words``, transpose two words to the left of the cursor
- ``togglecase-char``, toggle the capitalisation (case) of the character under the cursor
- ``togglecase-selection``, toggle the capitalisation (case) of the selection
- ``insert-line-under``, add a new line under the current line
- ``insert-line-over``, add a new line over the current line
@@ -199,6 +203,24 @@ The following special input functions are available:
- ``yank-pop``, rotate to the previous entry of the killring
Additional functions
--------------------
The following functions are included as normal functions, but are particularly useful for input editing:
- ``up-or-search`` and ``down-or-search``, which move the cursor or search the history depending on the cursor position and current mode
- ``edit_command_buffer``, open the visual editor (controlled by the ``VISUAL`` or ``EDITOR`` environment variables) with the current command-line contents
- ``delete-or-exit``, quit the shell if the current command-line is empty, or delete the character under the cursor if not
- ``fish_clipboard_copy``, copy the current selection to the system clipboard
- ``fish_clipboard_paste``, paste the current selection from the system clipboard before the cursor
- ``fish_commandline_append``, append the argument to the command-line. If the command-line already ends with the argument, this removes the suffix instead. Starts with the last command from history if the command-line is empty.
- ``fish_commandline_prepend``, prepend the argument to the command-line. If the command-line already starts with the argument, this removes the prefix instead. Starts with the last command from history if the command-line is empty.
Examples
--------
@@ -210,7 +232,7 @@ Perform a history search when :kbd:`Page Up` is pressed::
bind -k ppage history-search-backward
Turn on Vi key bindings and rebind :kbd:`Control`\ +\ :kbd:`C` to clear the input line::
Turn on :ref:`Vi key bindings <vi-mode>` and rebind :kbd:`Control`\ +\ :kbd:`C` to clear the input line::
set -g fish_key_bindings fish_vi_key_bindings
bind -M insert \cc kill-whole-line repaint

View File

@@ -21,7 +21,7 @@ With ``CMD`` specified, the command line buffer is erased and replaced with the
The following options are available:
- ``-C`` or ``--cursor`` set or get the current cursor position, not the contents of the buffer. If no argument is given, the current cursor position is printed, otherwise the argument is interpreted as the new cursor position.
- ``-C`` or ``--cursor`` set or get the current cursor position, not the contents of the buffer. If no argument is given, the current cursor position is printed, otherwise the argument is interpreted as the new cursor position. If one of the options ``-j``, ``-p`` or ``-t`` is given, the position is relative to the respective substring instead of the entire command line buffer.
- ``-f`` or ``--function`` causes any additional arguments to be interpreted as input functions, and puts them into the queue, so that they will be read before any additional actual key presses are. This option cannot be combined with any other option. See :ref:`bind <cmd-bind>` for a list of input functions.
@@ -35,7 +35,7 @@ The following options change the way ``commandline`` updates the command line bu
The following options change what part of the commandline is printed or updated:
- ``-b`` or ``--current-buffer`` select the entire buffer, including any displayed autosuggestion (default)
- ``-b`` or ``--current-buffer`` select the entire commandline, not including any displayed autosuggestion (default)
- ``-j`` or ``--current-job`` select the current job - a `job` here is one pipeline. It stops at logical operators or terminators (``;``, ``&`` or newlines).

View File

@@ -13,7 +13,7 @@ Synopsis
[( -e | --erase )]
[( -s | --short-option ) SHORT_OPTION]...
[( -l | --long-option | -o | --old-option ) LONG_OPTION]...
[( -a | --arguments ) OPTION_ARGUMENTS]
[( -a | --arguments ) ARGUMENTS]
[( -k | --keep-order )]
[( -f | --no-files )]
[( -F | --force-files )]
@@ -44,9 +44,9 @@ the fish manual.
- ``-o LONG_OPTION`` or ``--old-option=LONG_OPTION`` adds an old style long option to the completions list (See below for details).
- ``-a OPTION_ARGUMENTS`` or ``--arguments=OPTION_ARGUMENTS`` adds the specified option arguments to the completions list.
- ``-a ARGUMENTS`` or ``--arguments=ARGUMENTS`` adds the specified option arguments to the completions list.
- ``-k`` or ``--keep-order`` keeps the order of the ``OPTION_ARGUMENTS`` instead of sorting alphabetically. Multiple ``complete`` calls with ``-k`` result in arguments of the later ones displayed first.
- ``-k`` or ``--keep-order`` keeps the order of ``ARGUMENTS`` instead of sorting alphabetically. Multiple ``complete`` calls with ``-k`` result in arguments of the later ones displayed first.
- ``-f`` or ``--no-files`` says that this completion may not be followed by a filename.
@@ -76,9 +76,9 @@ Multiple command switches and wrapped commands can also be given to define multi
Invoking ``complete`` multiple times for the same command adds the new definitions on top of any existing completions defined for the command.
When ``-a`` or ``--arguments`` is specified in conjunction with long, short, or old style options, the specified arguments are only completed as arguments for any of the specified options. If ``-a`` or ``--arguments`` is specified without any long, short, or old style options, the specified arguments are used when completing any argument to the command (except when completing an option argument that was specified with ``-r`` or ``--require-parameter``).
When ``-a`` or ``--arguments`` is specified in conjunction with long, short, or old style options, the specified arguments are only completed as arguments for any of the specified options. If ``-a`` or ``--arguments`` is specified without any long, short, or old style options, the specified arguments are used when completing non-option arguments to the command (except when completing an option argument that was specified with ``-r`` or ``--require-parameter``).
Command substitutions found in ``OPTION_ARGUMENTS`` should return a newline-separated list of arguments, and each argument may optionally have a tab character followed by the argument description. Description given this way override a description given with ``-d`` or ``--description``.
Command substitutions found in ``ARGUMENTS`` should return a newline-separated list of arguments, and each argument may optionally have a tab character followed by the argument description. Description given this way override a description given with ``-d`` or ``--description``.
The ``-w`` or ``--wraps`` options causes the specified command to inherit completions from another command, "wrapping" the other command. The wrapping command can also have additional completions. A command can wrap multiple commands, and wrapping is transitive: if A wraps B, and B wraps C, then A automatically inherits all of C's completions. Wrapping can be removed using the ``-e`` or ``--erase`` options. Wrapping only works for completions specified with ``-c`` or ``--command`` and are ignored when specifying completions with ``-p`` or ``--path``.

View File

@@ -8,23 +8,37 @@ Synopsis
::
fish_config [TAB]
fish_config
fish_config browse
fish_config prompt (choose | list | save | show)
Description
-----------
``fish_config`` starts the web-based configuration interface.
``fish_config`` is used to configure fish.
The web interface allows you to view your functions, variables and history, and to make changes to your prompt and color configuration.
``fish_config`` starts a local web server and then opens a web browser window; when you have finished, close the browser window and then press the Enter key to terminate the configuration session.
``fish_config`` optionally accepts name of the initial configuration tab. For e.g. ``fish_config history`` will start configuration interface with history tab.
Without arguments or with the ``browse`` command it starts the web-based configuration interface. The web interface allows you to view your functions, variables and history, and to make changes to your prompt and color configuration. It starts a local web server and opens a browser window. When you are finished, close the browser window and press the Enter key to terminate the configuration session.
If the ``BROWSER`` environment variable is set, it will be used as the name of the web browser to open instead of the system default.
With the ``prompt`` command ``fish_config`` can be used to view and choose a prompt from fish's sample prompts inside the terminal directly.
Available subcommands for the ``prompt`` command:
- ``choose`` loads a sample prompt in the current session.
- ``list`` lists the names of the available sample prompts.
- ``save`` saves the current prompt to a file (via :ref:`funcsave <cmd-funcsave>`).
- ``show`` shows what the given sample prompts (or all) would look like.
Example
-------
``fish_config`` opens a new web browser window and allows you to configure certain fish settings.
``fish_config`` or ``fish_config browse`` opens a new web browser window and allows you to configure certain fish settings.
``fish_config prompt show`` demos the available sample prompts.
``fish_config prompt choose disco`` makes the disco prompt the prompt for the current session. This can also be used in :ref:`config.fish <configuration>` to set the prompt.
``fish_config prompt save`` saves the current prompt to an :ref:`autoloaded <syntax-function-autoloading>` file.
``fish_config prompt save default`` chooses the default prompt and saves it.

View File

@@ -15,8 +15,8 @@ Synopsis
Description
-----------
``funcsave`` saves a function to a file in the fish configuration directory. This function will be automatically loaded by current and future fish sessions. This can be useful if you have interactively created a new function and wish to save it for later use.
``funcsave`` saves a function to a file in the fish configuration directory. This function will be :ref:`automatically loaded <syntax-function-autoloading>` by current and future fish sessions. This can be useful if you have interactively created a new function and wish to save it for later use.
Note that because fish loads functions on-demand, saved functions will not function as :ref:`event handlers <event>` until they are run or sourced otherwise. To activate an event handler for every new shell, add the function to your :ref:`shell initialization file <initialization>` instead of using ``funcsave``.
Note that because fish loads functions on-demand, saved functions will not function as :ref:`event handlers <event>` until they are run or sourced otherwise. To activate an event handler for every new shell, add the function to your :ref:`configuration file <configuration>` instead of using ``funcsave``.
This is typically used together with :ref:`funced <cmd-funced>`, which will open the function in your editor and load it in the current seession afterwards.

View File

@@ -28,9 +28,9 @@ The following options are available:
- ``-e`` or ``--on-event EVENT_NAME`` tells fish to run this function when the specified named event is emitted. Fish internally generates named events e.g. when showing the prompt.
- ``-v`` or ``--on-variable VARIABLE_NAME`` tells fish to run this function when the variable VARIABLE_NAME changes value. Note that the function will not necessarily be run for each change; rather, it will be run when the variable has changed at least once.
- ``-v`` or ``--on-variable VARIABLE_NAME`` tells fish to run this function when the variable VARIABLE_NAME changes value. Note that fish makes no guarantees on any particular timing or even that the function will be run for every single ``set``. Rather it will be run when the variable has been set at least once, possibly skipping some values or being run when the variable has been set to the same value (except for universal variables set in other shells - only changes in the value will be picked up for those).
- ``-j PGID`` or ``--on-job-exit PGID`` tells fish to run this function when the job with group ID PGID exits. Instead of PGID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
- ``-j PID`` or ``--on-job-exit PID`` tells fish to run this function when the job containing a child process with the given PID exits. Instead of PID, the string 'caller' can be specified. This is only legal when in a command substitution, and will result in the handler being triggered by the exit of the job which created this command substitution.
- ``-p PID`` or ``--on-process-exit PID`` tells fish to run this function when the fish child process
with process ID PID exits. Instead of a PID, for backward compatibility,
@@ -115,4 +115,9 @@ This will beep when the most recent job completes.
Notes
-----
Note that events are only received from the current fish process as there is no way to send events from one fish process to another.
Events are only received from the current fish process as there is no way to send events from one fish process to another.
See more
--------
For more explanation of how functions fit into fish, see :ref:`Functions <syntax-function>`.

View File

@@ -39,6 +39,8 @@ The following options are available:
You should not assume that only five lines will be written since we may add additional information to the output in the future.
- ``--no-details`` turns off function path reporting, so just the definition will be printed.
- ``-n`` or ``--names`` lists the names of all defined functions.
- ``-q`` or ``--query`` tests if the specified functions exist.
@@ -53,8 +55,6 @@ The default behavior of ``functions``, when called with no arguments, is to prin
If any non-option parameters are given, the definition of the specified functions are printed.
Automatically loaded functions cannot be removed using ``functions -e``. Either remove the definition file or change the $fish_function_path variable to remove autoloaded functions.
Copying a function using ``-c`` copies only the body of the function, and does not attach any event notifications from the original function.
Only one function's description can be changed in a single invocation of ``functions -d``.
@@ -77,3 +77,7 @@ Examples
functions -e bar
# Erases the function ``bar``
See more
--------
For more explanation of how functions fit into fish, see :ref:`Functions <syntax-function>`.

View File

@@ -20,8 +20,11 @@ By default, the output is a floating-point number with trailing zeroes trimmed.
Keep in mind that parameter expansion happens before expressions are evaluated. This can be very useful in order to perform calculations involving shell variables or the output of command substitutions, but it also means that parenthesis (``()``) and the asterisk (``*``) glob character have to be escaped or quoted. ``x`` can also be used to denote multiplication, but it needs to be followed by whitespace to distinguish it from hexadecimal numbers.
Parentheses for functions are optional - ``math sin pi`` prints ``0``. However, a comma will bind to the inner function, so ``math pow sin 3, 5`` is an error because it tries to give ``sin`` the arguments ``3`` and ``5``. When in doubt, use parentheses.
``math`` ignores whitespace between arguments and takes its input as multiple arguments (internally joined with a space), so ``math 2 +2`` and ``math "2 + 2"`` work the same. ``math 2 2`` is an error.
The following options are available:
- ``-sN`` or ``--scale=N`` sets the scale of the result. ``N`` must be an integer or the word "max" for the maximum scale. A scale of zero causes results to be rounded down to the nearest integer. So ``3/2`` returns ``1`` rather than ``2`` which ``1.5`` would normally round to. This is for compatibility with ``bc`` which was the basis for this command prior to fish 3.0.0. Scale values greater than zero causes the result to be rounded using the usual rules to the specified number of decimal places.
@@ -87,6 +90,9 @@ Functions
- ``floor`` - round number down to nearest integer
- ``ln`` - the base-e logarithm
- ``log`` or ``log10`` - the base-10 logarithm
- ``log2`` - the base-2 logarithm
- ``max`` - returns the larger of two numbers
- ``min`` - returns the smaller of two numbers
- ``ncr`` - "from n choose r" combination function - how many subsets of size r can be taken from n (order doesn't matter)
- ``npr`` - the number of subsets of size r that can be taken from a set of n elements (including different order)
- ``pow(x,y)`` returns x to the y (and can be written as ``x ^ y``)
@@ -118,7 +124,7 @@ Examples
``math 0xFF`` outputs 255, ``math 0 x 3`` outputs 0 (because it computes 0 multiplied by 3).
``math "bitand(0xFE, 0x2e)"`` outputs 46.
``math bitand 0xFE, 0x2e`` outputs 46.
``math "bitor(9,2)"`` outputs 11.

View File

@@ -0,0 +1,26 @@
.. _cmd-prompt_login:
prompt_login - describe the login suitable for prompt
=====================================================
Synopsis
--------
::
function fish_prompt
echo -n (prompt_login) (prompt_pwd) '$ '
end
Description
-----------
``prompt_login`` is a function to describe the current login. It will show the user, the host and also whether the shell is running in a chroot (currently debian's debian_chroot is supported).
Examples
--------
::
>_ prompt_login
root@bananablaster

View File

@@ -26,25 +26,23 @@ Example
::
pushd /usr/src
# Working directory is now /usr/src
# Directory stack contains /usr/src
cd ~/dir1
pushd ~/dir2
pushd ~/dir3
# Working directory is now ~/dir3
# Directory stack contains ~/dir2 ~/dir1
pushd /usr/src/fish-shell
# Working directory is now /usr/src/fish-shell
# Directory stack contains /usr/src /usr/src/fish-shell
pushd /tmp/
pushd /tmp
# Working directory is now /tmp
# Directory stack contains /tmp /usr/src /usr/src/fish-shell
# Directory stack contains ~/dir3 ~/dir2 ~/dir1
pushd +1
# Working directory is now /usr/src
# Directory stack contains /usr/src /usr/src/fish-shell /tmp
# Working directory is now ~/dir3
# Directory stack contains ~/dir2 ~/dir1 /tmp
popd
# Working directory is now /usr/src/fish-shell
# Directory stack contains /usr/src/fish-shell /tmp
# Working directory is now ~/dir2
# Directory stack contains ~/dir1 /tmp
See Also
--------

View File

@@ -21,39 +21,47 @@ Description
``set`` manipulates :ref:`shell variables <variables>`.
If set is called with no arguments, the names and values of all shell variables are printed in sorted order. If some of the scope or export flags have been given, only the variables matching the specified scope are printed.
If both a variable name and values are provided, ``set`` assigns the values to the variable of that name. Because all variables in fish are :ref:`lists <variables-lists>`, multiple values are allowed.
With both variable names and values provided, ``set`` assigns the variable ``VARIABLE_NAME`` the values ``VALUES...``.
If only a variable name has been given, ``set`` sets the variable to the empty list.
If ``set`` is called with no arguments, it prints the names and values of all shell variables in sorted order. Passing :ref:`scope <variables-scope>` or :ref:`export <variables-export>` flags allows filtering this to only matching variables, so ``set --local`` would only show local variables.
With ``--erase`` and optionally a scope flag ``set`` will erase the matching variable (or the variable of that name in the smallest possible scope).
With ``--show``, ``set`` will describe the given variable names, explaining how they have been defined - in which scope with which values and options.
The following options control variable scope:
- ``-a`` or ``--append`` causes the values to be appended to the current set of values for the variable. This can be used with ``--prepend`` to both append and prepend at the same time. This cannot be used when assigning to a variable slice.
- ``-p`` or ``--prepend`` causes the values to be prepended to the current set of values for the variable. This can be used with ``--append`` to both append and prepend at the same time. This cannot be used when assigning to a variable slice.
- ``-l`` or ``--local`` forces the specified shell variable to be given a scope that is local to the current block, even if a variable with the given name exists and is non-local
- ``-g`` or ``--global`` causes the specified shell variable to be given a global scope. Non-global variables disappear when the block they belong to ends
- ``-U`` or ``--universal`` causes the specified shell variable to be given a universal scope. If this option is supplied, the variable will be shared between all the current user's fish instances on the current computer, and will be preserved across restarts of the shell.
These options control additional variable options:
- ``-x`` or ``--export`` causes the specified shell variable to be exported to child processes (making it an "environment variable")
- ``-u`` or ``--unexport`` causes the specified shell variable to NOT be exported to child processes
- ``--path`` causes the specified variable to be treated as a path variable, meaning it will automatically be split on colons, and joined using colons when quoted (`echo "$PATH"`) or exported.
- ``--path`` causes the specified variable to be treated as a path variable, meaning it will automatically be split on colons, and joined using colons when quoted (``echo "$PATH"``) or exported.
- ``--unpath`` causes the specified variable to not be treated as a path variable. Variables with a name ending in "PATH" are automatically path variables, so this can be used to treat such a variable normally.
The following options are available:
The following other options are available:
- ``-a`` or ``--append`` causes the values to be appended to the current set of values for the variable. This can be used with ``--prepend`` to both append and prepend at the same time. This cannot be used when assigning to a variable slice.
- ``-p`` or ``--prepend`` causes the values to be prepended to the current set of values for the variable. This can be used with ``--append`` to both append and prepend at the same time. This cannot be used when assigning to a variable slice.
- ``-e`` or ``--erase`` causes the specified shell variables to be erased
- ``-q`` or ``--query`` test if the specified variable names are defined. Does not output anything, but the builtins exit status is the number of variables specified that were not defined, or 255 if more than 255 variables are not defined.
- ``-n`` or ``--names`` List only the names of all defined variables, not their value. The names are guaranteed to be sorted.
- ``-n`` or ``--names``: List only the names of all defined variables, not their value. The names are guaranteed to be sorted.
- ``-S`` or ``--show`` Shows information about the given variables. If no variable names are given then all variables are shown in sorted order. It shows the scopes the given variables are set in, along with the values in each and whether or not it is exported. No other flags can be used with this option.
- ``-S`` or ``--show`` shows information about the given variables. If no variable names are given then all variables are shown in sorted order. It shows the scopes the given variables are set in, along with the values in each and whether or not it is exported. No other flags can be used with this option.
- ``-L`` or ``--long`` do not abbreviate long values when printing set variables

View File

@@ -63,7 +63,7 @@ The following operations (sub-commands) are available:
- ``fish-path`` prints the absolute path to the currently executing instance of fish.
- ``function`` prints the name of the currently called function if able, when missing displays "Not a
function" (or equivalent translated string). Also ``current-function``, ``-u`` or ``--current-function``.
function" (or equivalent translated string). Also ``current-function``.
- ``line-number`` prints the line number of the currently running script. Also ``current-line-number``, ``-n`` or ``--current-line-number``.
@@ -78,6 +78,6 @@ The following operations (sub-commands) are available:
Notes
-----
For backwards compatibility each subcommand can also be specified as a long or short option. For example, rather than ``status is-login`` you can type ``status --is-login``. The flag forms are deprecated and may be removed in a future release (but not before fish 3.0).
For backwards compatibility most subcommands can also be specified as a long or short option. For example, rather than ``status is-login`` you can type ``status --is-login``. The flag forms are deprecated and may be removed in a future release (but not before fish 4.0).
You can only specify one subcommand per invocation even if you use the flag form of the subcommand.

View File

@@ -22,6 +22,8 @@ Description
``string join0`` joins its STRING arguments into a single string separated by the zero byte (NUL), and adds a trailing NUL. This is most useful in conjunction with tools that accept NUL-delimited input, such as ``sort -z``. Exit status: 0 if at least one join was performed, or 1 otherwise.
Because Unix uses NUL as the string terminator, passing the output of ``string join0`` as an *argument* to a command (via a :ref:`command substitution <expand-command-substitution>`) won't actually work. Fish will pass the correct bytes along, but the command won't be able to tell where the argument ends. This is a limitation of Unix' argument passing.
.. END DESCRIPTION
Examples
@@ -34,4 +36,11 @@ Examples
>_ seq 3 | string join ...
1...2...3
# Give a list of NUL-separated filenames to du (this is a GNU extension)
>_ string join0 file1 file2 file\nwith\nmultiple\nlines | du --files0-from=-
# Just put the strings together without a separator
>_ string join '' a b c
abc
.. END EXAMPLES

View File

@@ -119,7 +119,7 @@ These paths are controlled by parameters set at build, install, or run time, and
This wide search may be confusing. If you are unsure, your completions probably belong in ``~/.config/fish/completions``.
If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in `Further help and development <#more-help>`_.
If you have written new completions for a common Unix command, please consider sharing your work by submitting it via the instructions in :ref:`Further help and development <more-help>`
If you are developing another program and would like to ship completions with your program, install them to the "vendor" completions directory. As this path may vary from system to system, the ``pkgconfig`` framework should be used to discover this path with the output of ``pkg-config --variable completionsdir fish``.

View File

@@ -73,7 +73,7 @@ highlight_language = "fish-docs-samples"
# -- Project information -----------------------------------------------------
project = "fish-shell"
copyright = "2020, fish-shell developers"
copyright = "2021, fish-shell developers"
author = "fish-shell developers"
issue_url = "https://github.com/fish-shell/fish-shell/issues"
@@ -210,12 +210,17 @@ def get_command_description(path, name):
return desc.strip()
raise SphinxWarning("No description in file %s" % os.path.basename(path))
# Newer sphinxen apparently create another subdirectory which breaks our man lookup.
# Unbreak it (#7996)
man_make_section_directory = False
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, "fish-doc", "fish-shell Documentation", [author], 1),
("tutorial", "fish-tutorial", "fish-shell tutorial", [author], 1),
("language", "fish-language", "The fish language", [author], 1),
("interactive", "fish-interactive", "Using fish interactively", [author], 1),
("relnotes", "fish-releasenotes", "fish-shell release notes", [author], 1),
("completions", "fish-completions", "Writing fish completions", [author], 1),
(

View File

@@ -64,7 +64,7 @@ variables.
This means that the global value takes precedence over the universal value.
To avoid this problem, consider changing the setting which fish inherits. If this is not possible,
add a statement to your :ref:`user initialization file <initialization>` (usually
add a statement to your :ref:`configuration file <configuration>` (usually
``~/.config/fish/config.fish``)::
set -gx EDITOR vim
@@ -296,6 +296,7 @@ In fish versions prior to 2.5.0 it was possible to create a function named ``-``
The open command doesn't work.
------------------------------
The ``open`` command uses the MIME type database and the ``.desktop`` files used by Gnome and KDE to identify filetypes and default actions. If at least one of these environments is installed, but the open command is not working, this probably means that the relevant files are installed in a non-standard location. Consider :ref:`asking for more help <more-help>`.
.. _faq-ssh-interactive:
Why won't SSH/SCP/rsync connect properly when fish is my login shell?
@@ -305,7 +306,7 @@ This problem may show up as messages like "``Received message too long``", "``op
failed: not a terminal``", "``Bad packet length``", or "``Connection refused``" with strange output
in ``ssh_exchange_identification`` messages in the debug log.
This usually happens because fish reads the :ref:`user configuration file <initialization>` (``~/.config/fish/config.fish``) *always*,
This usually happens because fish reads the :ref:`user configuration file <configuration>` (``~/.config/fish/config.fish``) *always*,
whether it's in an interactive or login or non-interactive or non-login shell.
This simplifies matters, but it also means when config.fish generates output, it will do that even in non-interactive shells like the one ssh/scp/rsync start when they connect.
@@ -321,8 +322,8 @@ The same applies for example when you start ``tmux`` in config.fish without guar
.. _faq-unicode:
I'm getting weird graphical glitches (a staircase effect, ghost characters,...)?
--------------------------------------------------------------------------------
I'm getting weird graphical glitches (a staircase effect, ghost characters, cursor in the wrong position,...)?
--------------------------------------------------------------------------------------------------------------
In a terminal, the application running inside it and the terminal itself need to agree on the width of characters in order to handle cursor movement.
This is more important to fish than other shells because features like syntax highlighting and autosuggestions are implemented by moving the cursor.

View File

@@ -7,6 +7,8 @@ This is to give you a quick overview if you come from bash (or to a lesser exten
Many things are similar - they both fundamentally expand commandlines to execute commands, have pipes, redirections, variables, globs, use command output in various ways. This document is there to quickly show you the differences.
.. _bash-command-substitutions:
Command substitutions
---------------------
@@ -262,6 +264,48 @@ Fish's blocking constructs look a little different. They all start with a word,
Fish does not have an ``until``. Use ``while not`` or ``while !``.
Subshells
---------
Bash has a feature called "subshells", where it will start another shell process for certain things. That shell will then be independent and e.g. any changes it makes to variables won't be visible in the main shell.
This includes things like:
.. code-block:: sh
# A list of commands in `()` parentheses
(foo; bar) | baz
# Both sides of a pipe
foo | while read -r bar; do
# This variable will not be visible outside of the while loop.
VAR=VAL
# This background process will not be, either
baz &
done
``()`` subshells are often confused with ``{}`` grouping, which does *not* use a subshell. When you just need to group, you can use ``begin; end`` in fish::
(foo; bar) | baz
# when it should really have been:
{ foo; bar } | baz
# becomes
begin; foo; bar; end | baz
The pipe will simply be run in the same process, so ``while read`` loops can set variables outside::
foo | while read bar
set -g VAR VAL
baz &
end
echo $VAR # will print VAL
jobs # will show "baz"
Subshells are also frequently confused with :ref:`command substitutions <bash-command-substitutions>`, which bash writes as ```command``` or ``$(command)`` and fish writes as ``(command)``. Bash also *uses* subshells to implement them.
The isolation can usually be achieved by just scoping variables (with ``set -l``), but if you really do need to run your code in a new shell environment you can always use ``fish -c 'your code here'`` to do so explicitly.
Builtins and other commands
---------------------------

File diff suppressed because it is too large Load Diff

571
doc_src/interactive.rst Normal file
View File

@@ -0,0 +1,571 @@
.. _interactive:
Interactive use
***************
Fish prides itself on being really nice to use interactively. That's down to a few features we'll explain in the next few sections.
Fish is used by giving commands in the fish language, see :ref:`The Fish Language <language>` for information on that.
Help
----
Fish has an extensive help system. Use the :ref:`help <cmd-help>` command to obtain help on a specific subject or command. For instance, writing ``help syntax`` displays the :ref:`syntax section <syntax>` of this documentation.
Fish also has man pages for its commands, and translates the help pages to man pages. For example, ``man set`` will show the documentation for ``set`` as a man page.
Help on a specific builtin can also be obtained with the ``-h`` parameter. For instance, to obtain help on the :ref:`fg <cmd-fg>` builtin, either type ``fg -h`` or ``help fg``.
This page can be viewed via ``help index`` (or just ``help``) or ``man fish-doc``. The tutorial can be viewed with ``help tutorial`` or ``man fish-tutorial``.
.. _autosuggestions:
Autosuggestions
---------------
fish suggests commands as you type, based on :ref:`command history <history-search>`, completions, and valid file paths. As you type commands, you will see a suggestion offered after the cursor, in a muted gray color (which can be changed with the ``fish_color_autosuggestion`` variable).
To accept the autosuggestion (replacing the command line contents), press :kbd:`→` or :kbd:`Control`\ +\ :kbd:`F`. To accept the first suggested word, press :kbd:`Alt`\ +\ :kbd:`→` or :kbd:`Alt`\ +\ :kbd:`F`. If the autosuggestion is not what you want, just ignore it: it won't execute unless you accept it.
Autosuggestions are a powerful way to quickly summon frequently entered commands, by typing the first few characters. They are also an efficient technique for navigating through directory hierarchies.
.. _tab-completion:
Tab Completion
--------------
Tab completion is a time saving feature of any modern shell. When you type :kbd:`Tab`, fish tries to guess the rest of the word under the cursor. If it finds just one possibility, it inserts it. If it finds more, it inserts the longest unambiguous part and then opens a menu (the "pager") that you can navigate to find what you're looking for.
The pager can be navigated with the arrow keys, :kbd:`Page Up` / :kbd:`Page Down`, :kbd:`Tab` or :kbd:`Shift`\ +\ :kbd:`Tab`. Pressing :kbd:`Control`\ +\ :kbd:`S` (the ``pager-toggle-search`` binding - :kbd:`/` in vi-mode) opens up a search menu that you can use to filter the list.
Fish provides some general purpose completions:
- Commands (builtins, functions and regular programs).
- Shell variable names.
- Usernames for tilde expansion.
- Filenames, even on strings with wildcards such as ``*`` and ``**``.
It also provides a large number of program specific scripted completions. Most of these completions are simple options like the ``-l`` option for ``ls``, but some are more advanced. For example:
- The programs ``man`` and ``whatis`` show all installed manual pages as completions.
- The ``make`` program uses all targets in the Makefile in the current directory as completions.
- The ``mount`` command uses all mount points specified in fstab as completions.
- The ``ssh`` command uses all hosts that are stored in the known_hosts file as completions. (See the ssh documentation for more information)
- The ``su`` command shows the users on the system
- The ``apt-get``, ``rpm`` and ``yum`` commands show installed or installable packages
You can also write your own completions or install some you got from someone else. For that, see :ref:`Writing your own completions <completion-own>`.
.. _color:
Syntax highlighting
-------------------
Fish interprets the command line as it is typed and uses syntax highlighting to provide feedback. The most important feedback is the detection of potential errors. By default, errors are marked red.
Detected errors include:
- Non existing commands.
- Reading from or appending to a non existing file.
- Incorrect use of output redirects
- Mismatched parenthesis
When the cursor is over a parenthesis or a quote, fish also highlights its matching quote or parenthesis.
To customize the syntax highlighting, you can set the environment variables listed in the :ref:`Variables for changing highlighting colors <variables-color>` section.
.. _variables-color:
Syntax highlighting variables
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The colors used by fish for syntax highlighting can be configured by changing the values of a various variables. The value of these variables can be one of the colors accepted by the :ref:`set_color <cmd-set_color>` command. The modifier switches accepted by ``set_color`` like ``--bold``, ``--dim``, ``--italics``, ``--reverse`` and ``--underline`` are also accepted.
Example: to make errors highlighted and red, use::
set fish_color_error red --bold
The following variables are available to change the highlighting colors in fish:
========================================== =====================================================================
Variable Meaning
========================================== =====================================================================
``fish_color_normal`` default color
``fish_color_command`` commands like echo
``fish_color_keyword`` keywords like if - this falls back on the command color if unset
``fish_color_quote`` quoted text like "abc"
``fish_color_redirection`` IO redirections like >/dev/null
``fish_color_end`` process separators like ';' and '&'
``fish_color_error`` syntax errors
``fish_color_param`` ordinary command parameters
``fish_color_comment`` comments like '# important'
``fish_color_selection`` selected text in vi visual mode
``fish_color_operator`` parameter expansion operators like '*' and '~'
``fish_color_escape`` character escapes like '\n' and '\x70'
``fish_color_autosuggestion`` autosuggestions (the proposed rest of a command)
``fish_color_cwd`` the current working directory in the default prompt
``fish_color_user`` the username in the default prompt
``fish_color_host`` the hostname in the default prompt
``fish_color_host_remote`` the hostname in the default prompt for remote sessions (like ssh)
``fish_color_cancel`` the '^C' indicator on a canceled command
``fish_color_search_match`` history search matches and selected pager items (background only)
========================================== =====================================================================
If a variable isn't set, fish usually tries ``$fish_color_normal``, except for ``$fish_color_keyword``, where it tries ``$fish_color_command`` first.
.. _variables-color-pager:
Pager color variables
^^^^^^^^^^^^^^^^^^^^^^^
fish will sometimes present a list of choices in a table, called the pager.
Example: to set the background of each pager row, use::
set fish_pager_color_background --background=white
To have black text on alternating white and gray backgrounds::
set fish_pager_color_prefix black
set fish_pager_color_completion black
set fish_pager_color_description black
set fish_pager_color_background --background=white
set fish_pager_color_secondary_background --background=brwhite
Variables affecting the pager colors:
========================================== ===========================================================
Variable Meaning
========================================== ===========================================================
``fish_pager_color_progress`` the progress bar at the bottom left corner
``fish_pager_color_background`` the background color of a line
``fish_pager_color_prefix`` the prefix string, i.e. the string that is to be completed
``fish_pager_color_completion`` the completion itself, i.e. the proposed rest of the string
``fish_pager_color_description`` the completion description
``fish_pager_color_selected_background`` background of the selected completion
``fish_pager_color_selected_prefix`` prefix of the selected completion
``fish_pager_color_selected_completion`` suffix of the selected completion
``fish_pager_color_selected_description`` description of the selected completion
``fish_pager_color_secondary_background`` background of every second unselected completion
``fish_pager_color_secondary_prefix`` prefix of every second unselected completion
``fish_pager_color_secondary_completion`` suffix of every second unselected completion
``fish_pager_color_secondary_description`` description of every second unselected completion
========================================== ===========================================================
When the secondary or selected variables aren't set, the normal variables are used, except for ``$fish_pager_color_selected_background``, where the background of ``$fish_color_search_match`` is tried first.
.. _abbreviations:
Abbreviations
-------------
To avoid needless typing, a frequently-run command like ``git checkout`` can be abbreviated to ``gco`` using the :ref:`abbr <cmd-abbr>` command.
::
abbr -a gco git checkout
After entering ``gco`` and pressing :kbd:`Space` or :kbd:`Enter`, the full text ``git checkout`` will appear in the command line.
This is an alternative to aliases, and has the advantage that you see the actual command before using it, and the actual command will be stored in history.
.. _title:
Programmable title
------------------
When using most virtual terminals, it is possible to set the message displayed in the titlebar of the terminal window. This can be done automatically in fish by defining the :ref:`fish_title <cmd-fish_title>` function. The :ref:`fish_title <cmd-fish_title>` function is executed before and after a new command is executed or put into the foreground and the output is used as a titlebar message. The :ref:`status current-command <cmd-status>` builtin will always return the name of the job to be put into the foreground (or ``fish`` if control is returning to the shell) when the `fish_prompt <cmd-fish_prompt>` function is called. The first argument to fish_title will contain the most recently executed foreground command as a string, starting with fish 2.2.
Examples:
The default fish title is::
function fish_title
echo (status current-command) ' '
pwd
end
To show the last command in the title::
function fish_title
echo $argv[1]
end
.. _prompt:
Programmable prompt
-------------------
When fish waits for input, it will display a prompt by evaluating the :ref:`fish_prompt <cmd-fish_prompt>` and :ref:`fish_right_prompt <cmd-fish_right_prompt>` functions. The output of the former is displayed on the left and the latter's output on the right side of the terminal. The output of :ref:`fish_mode_prompt <cmd-fish_mode_prompt>` will be prepended on the left, though the default function only does this when in :ref:`vi-mode <vi-mode>`.
.. _greeting:
Configurable greeting
---------------------
If a function named :ref:`fish_greeting <cmd-fish_greeting>` exists, it will be run when entering interactive mode. Otherwise, if an environment variable named :ref:`fish_greeting <cmd-fish_greeting>` exists, it will be printed.
.. _private-mode:
Private mode
-------------
If ``$fish_private_mode`` is set to a non-empty value, commands will not be written to the history file on disk.
You can also launch with ``fish --private`` (or ``fish -P`` for short). This both hides old history and prevents writing history to disk. This is useful to avoid leaking personal information (e.g. for screencasts) or when dealing with sensitive information.
You can query the variable ``fish_private_mode`` (``if test -n "$fish_private_mode" ...``) if you would like to respect the user's wish for privacy and alter the behavior of your own fish scripts.
.. _editor:
Command line editor
-------------------
The fish editor features copy and paste, a :ref:`searchable history <history-search>` and many editor functions that can be bound to special keyboard shortcuts.
Like bash and other shells, fish includes two sets of keyboard shortcuts (or key bindings): one inspired by the Emacs text editor, and one by the Vi text editor. The default editing mode is Emacs. You can switch to Vi mode by running ``fish_vi_key_bindings`` and switch back with ``fish_default_key_bindings``. You can also make your own key bindings by creating a function and setting the ``fish_key_bindings`` variable to its name. For example::
function fish_hybrid_key_bindings --description \
"Vi-style bindings that inherit emacs-style bindings in all modes"
for mode in default insert visual
fish_default_key_bindings -M $mode
end
fish_vi_key_bindings --no-erase
end
set -g fish_key_bindings fish_hybrid_key_bindings
While the key bindings included with fish include many of the shortcuts popular from the respective text editors, they are not a complete implementation. They include a shortcut to open the current command line in your preferred editor (:kbd:`Alt`\ +\ :kbd:`E` by default) if you need the full power of your editor.
.. _shared-binds:
Shared bindings
---------------
Some bindings are common across Emacs and Vi mode, because they aren't text editing bindings, or because what Vi/Vim does for a particular key doesn't make sense for a shell.
- :kbd:`Tab` :ref:`completes <tab-completion>` the current token. :kbd:`Shift`\ +\ :kbd:`Tab` completes the current token and starts the pager's search mode.
- :kbd:`←` (Left) and :kbd:`→` (Right) move the cursor left or right by one character. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`→` accepts the autosuggestion.
- :kbd:`Enter` executes the current commandline or inserts a newline if it's not complete yet (e.g. a ``)`` or ``end`` is missing).
- :kbd:`Alt`\ +\ :kbd:`Enter` inserts a newline at the cursor position.
- :kbd:`Alt`\ +\ :kbd:`←` and :kbd:`Alt`\ +\ :kbd:`→` move the cursor one word left or right (to the next space or punctuation mark), or moves forward/backward in the directory history if the command line is empty. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`Alt`\ +\ :kbd:`→` (or :kbd:`Alt`\ +\ :kbd:`F`) accepts the first word in the suggestion.
- :kbd:`Control`\ +\ :kbd:`←` and :kbd:`Control`\ +\ :kbd:`→` move the cursor one word left or right. These accept one word of the autosuggestion - the part they'd move over.
- :kbd:`Shift`\ +\ :kbd:`←` and :kbd:`Shift`\ +\ :kbd:`→` move the cursor one word left or right, without stopping on punctuation. These accept one big word of the autosuggestion.
- :kbd:`↑` (Up) and :kbd:`↓` (Down) (or :kbd:`Control`\ +\ :kbd:`P` and :kbd:`Control`\ +\ :kbd:`N` for emacs aficionados) search the command history for the previous/next command containing the string that was specified on the commandline before the search was started. If the commandline was empty when the search started, all commands match. See the :ref:`history <history-search>` section for more information on history searching.
- :kbd:`Alt`\ +\ :kbd:`↑` and :kbd:`Alt`\ +\ :kbd:`↓` search the command history for the previous/next token containing the token under the cursor before the search was started. If the commandline was not on a token when the search started, all tokens match. See the :ref:`history <history-search>` section for more information on history searching.
- :kbd:`Control`\ +\ :kbd:`C` cancels the entire line.
- :kbd:`Control`\ +\ :kbd:`D` delete one character to the right of the cursor. If the command line is empty, :kbd:`Control`\ +\ :kbd:`D` will exit fish.
- :kbd:`Control`\ +\ :kbd:`U` moves contents from the beginning of line to the cursor to the :ref:`killring <killring>`.
- :kbd:`Control`\ +\ :kbd:`L` clears and repaints the screen.
- :kbd:`Control`\ +\ :kbd:`R` searches the history if there is something in the commandline. This is mainly to ease the transition from other shells, where ctrl+r initiates the history search.
- :kbd:`Control`\ +\ :kbd:`W` moves the previous path component (everything up to the previous "/", ":" or "@") to the :ref:`killring`.
- :kbd:`Control`\ +\ :kbd:`X` copies the current buffer to the system's clipboard, :kbd:`Control`\ +\ :kbd:`V` inserts the clipboard contents.
- :kbd:`Alt`\ +\ :kbd:`D` moves the next word to the :ref:`killring`.
- :kbd:`Alt`\ +\ :kbd:`H` (or :kbd:`F1`) shows the manual page for the current command, if one exists.
- :kbd:`Alt`\ +\ :kbd:`L` lists the contents of the current directory, unless the cursor is over a directory argument, in which case the contents of that directory will be listed.
- :kbd:`Alt`\ +\ :kbd:`O` opens the file at the cursor in a pager.
- :kbd:`Alt`\ +\ :kbd:`P` adds the string ``&| less;`` to the end of the job under the cursor. The result is that the output of the command will be paged.
- :kbd:`Alt`\ +\ :kbd:`W` prints a short description of the command under the cursor.
- :kbd:`Alt`\ +\ :kbd:`E` edit the current command line in an external editor. The editor is chosen from the first available of the ``$VISUAL`` or ``$EDITOR`` variables.
- :kbd:`Alt`\ +\ :kbd:`V` Same as :kbd:`Alt`\ +\ :kbd:`E`.
- :kbd:`Alt`\ +\ :kbd:`S` Prepends ``sudo`` to the current commandline. If the commandline is empty, prepend ``sudo`` to the last commandline.
- :kbd:`Control`\ +\ :kbd:`Space` Inserts a space without expanding an :ref:`abbreviation <abbreviations>`. For vi-mode this only applies to insert-mode.
.. _emacs-mode:
Emacs mode commands
-------------------
- :kbd:`Home` or :kbd:`Control`\ +\ :kbd:`A` moves the cursor to the beginning of the line.
- :kbd:`End` or :kbd:`Control`\ +\ :kbd:`E` moves to the end of line. If the cursor is already at the end of the line, and an autosuggestion is available, :kbd:`End` or :kbd:`Control`\ +\ :kbd:`E` accepts the autosuggestion.
- :kbd:`Control`\ +\ :kbd:`B`, :kbd:`Control`\ +\ :kbd:`F` move the cursor one character left or right or accept the autosuggestion just like the :kbd:`←` (Left) and :kbd:`→` (Right) shared bindings (which are available as well).
- :kbd:`Control`\ +\ :kbd:`N`, :kbd:`Control`\ +\ :kbd:`P` move the cursor up/down or through history, like the up and down arrow shared bindings.
- :kbd:`Delete` or :kbd:`Backspace` removes one character forwards or backwards respectively.
- :kbd:`Control`\ +\ :kbd:`K` moves contents from the cursor to the end of line to the :ref:`killring`.
- :kbd:`Alt`\ +\ :kbd:`C` capitalizes the current word.
- :kbd:`Alt`\ +\ :kbd:`U` makes the current word uppercase.
- :kbd:`Control`\ +\ :kbd:`T` transposes the last two characters.
- :kbd:`Alt`\ +\ :kbd:`T` transposes the last two words.
- :kbd:`Control`\ +\ :kbd:`Z`, :kbd:`Control`\ +\ :kbd:`_` (:kbd:`Control`\ +\ :kbd:`/` on some terminals) undo the most recent edit of the line.
- :kbd:`Alt`\ +\ :kbd:`/` reverts the most recent undo.
You can change these key bindings using the :ref:`bind <cmd-bind>` builtin.
.. _vi-mode:
Vi mode commands
----------------
Vi mode allows for the use of Vi-like commands at the prompt. Initially, :ref:`insert mode <vi-mode-insert>` is active. :kbd:`Escape` enters :ref:`command mode <vi-mode-command>`. The commands available in command, insert and visual mode are described below. Vi mode shares :ref:`some bindings <shared-binds>` with :ref:`Emacs mode <emacs-mode>`.
It is also possible to add all emacs-mode bindings to vi-mode by using something like::
function fish_user_key_bindings
# Execute this once per mode that emacs bindings should be used in
fish_default_key_bindings -M insert
# Then execute the vi-bindings so they take precedence when there's a conflict.
# Without --no-erase fish_vi_key_bindings will default to
# resetting all bindings.
# The argument specifies the initial mode (insert, "default" or visual).
fish_vi_key_bindings --no-erase insert
end
When in vi-mode, the :ref:`fish_mode_prompt <cmd-fish_mode_prompt>` function will display a mode indicator to the left of the prompt. To disable this feature, override it with an empty function. To display the mode elsewhere (like in your right prompt), use the output of the ``fish_default_mode_prompt`` function.
When a binding switches the mode, it will repaint the mode-prompt if it exists, and the rest of the prompt only if it doesn't. So if you want a mode-indicator in your ``fish_prompt``, you need to erase ``fish_mode_prompt`` e.g. by adding an empty file at ``~/.config/fish/functions/fish_mode_prompt.fish``. (Bindings that change the mode are supposed to call the `repaint-mode` bind function, see :ref:`bind <cmd-bind>`)
The ``fish_vi_cursor`` function will be used to change the cursor's shape depending on the mode in supported terminals. The following snippet can be used to manually configure cursors after enabling vi-mode::
# Emulates vim's cursor shape behavior
# Set the normal and visual mode cursors to a block
set fish_cursor_default block
# Set the insert mode cursor to a line
set fish_cursor_insert line
# Set the replace mode cursor to an underscore
set fish_cursor_replace_one underscore
# The following variable can be used to configure cursor shape in
# visual mode, but due to fish_cursor_default, is redundant here
set fish_cursor_visual block
Additionally, ``blink`` can be added after each of the cursor shape parameters to set a blinking cursor in the specified shape.
If the cursor shape does not appear to be changing after setting the above variables, it's likely your terminal emulator does not support the capabilities necessary to do this. It may also be the case, however, that ``fish_vi_cursor`` has not detected your terminal's features correctly (for example, if you are using ``tmux``). If this is the case, you can force ``fish_vi_cursor`` to set the cursor shape by setting ``$fish_vi_force_cursor`` in ``config.fish``. You'll have to restart fish for any changes to take effect. If cursor shape setting remains broken after this, it's almost certainly an issue with your terminal emulator, and not fish.
.. _vi-mode-command:
Command mode
^^^^^^^^^^^^
Command mode is also known as normal mode.
- :kbd:`H` moves the cursor left.
- :kbd:`L` moves the cursor right.
- :kbd:`I` enters :ref:`insert mode <vi-mode-insert>` at the current cursor position.
- :kbd:`V` enters :ref:`visual mode <vi-mode-visual>` at the current cursor position.
- :kbd:`A` enters :ref:`insert mode <vi-mode-insert>` after the current cursor position.
- :kbd:`Shift`\ +\ :kbd:`A` enters :ref:`insert mode <vi-mode-insert>` at the end of the line.
- :kbd:`0` (zero) moves the cursor to beginning of line (remaining in command mode).
- :kbd:`D`\ +\ :kbd:`D` deletes the current line and moves it to the :ref:`killring`.
- :kbd:`Shift`\ +\ :kbd:`D` deletes text after the current cursor position and moves it to the :ref:`killring`.
- :kbd:`P` pastes text from the :ref:`killring`.
- :kbd:`U` search history backwards.
- :kbd:`[` and :kbd:`]` search the command history for the previous/next token containing the token under the cursor before the search was started. See the :ref:`history <history-search>` section for more information on history searching.
- :kbd:`Backspace` moves the cursor left.
.. _vi-mode-insert:
Insert mode
^^^^^^^^^^^
- :kbd:`Escape` enters :ref:`command mode <vi-mode-command>`.
- :kbd:`Backspace` removes one character to the left.
.. _vi-mode-visual:
Visual mode
^^^^^^^^^^^
- :kbd:`←` (Left) and :kbd:`→` (Right) extend the selection backward/forward by one character.
- :kbd:`B` and :kbd:`W` extend the selection backward/forward by one word.
- :kbd:`D` and :kbd:`X` move the selection to the :ref:`killring` and enter :ref:`command mode <vi-mode-command>`.
- :kbd:`Escape` and :kbd:`Control`\ +\ :kbd:`C` enter :ref:`command mode <vi-mode-command>`.
- :kbd:`c` and :kbd:`s` remove the selection and switch to insert mode
- :kbd:`d` and :kbd:`x` remove the selection and switch to normal mode
- :kbd:`X` removes the entire line and switches to normal mode
- :kbd:`y` copies the selection and switches to normal mode
- :kbd:`~` toggles the case (upper/lower) on the selection and switches to normal mode
- :kbd:`"*y` copies the selection to the clipboard and switches to normal mode
.. _custom-binds:
Custom bindings
---------------
In addition to the standard bindings listed here, you can also define your own with :ref:`bind <cmd-bind>`::
# Just clear the commandline on control-c
bind \cc 'commandline -r ""'
Put ``bind`` statements into :ref:`config.fish <configuration>` or a function called ``fish_user_key_bindings``.
The key sequence (the ``\cc``) here depends on your setup, in particular the terminal. To find out what the terminal sends use :ref:`fish_key_reader <cmd-fish_key_reader>`::
> fish_key_reader # pressing control-c
Press a key:
hex: 3 char: \cC
Press [ctrl-C] again to exit
bind \cC 'do something'
> fish_key_reader # pressing the right-arrow
Press a key:
hex: 1B char: \c[ (or \e)
( 0.077 ms) hex: 5B char: [
( 0.037 ms) hex: 43 char: C
bind \e\[C 'do something'
Note that some key combinations are indistinguishable or unbindable. For instance control-i *is the same* as the tab key. This is a terminal limitation that fish can't do anything about.
Also, :kbd:`Escape` is the same thing as :kbd:`Alt` in a terminal. To distinguish between pressing :kbd:`Escape` and then another key, and pressing :kbd:`Alt` and that key (or an escape sequence the key sends), fish waits for a certain time after seeing an escape character. This is configurable via the ``fish_escape_delay_ms`` variable.
If you want to be able to press :kbd:`Escape` and then a character and have it count as :kbd:`Alt`\ +\ that character, set it to a higher value, e.g.::
set -g fish_escape_delay_ms 100
.. _killring:
Copy and paste (Kill Ring)
--------------------------
Fish uses an Emacs-style kill ring for copy and paste functionality. For example, use :kbd:`Control`\ +\ :kbd:`K` (`kill-line`) to cut from the current cursor position to the end of the line. The string that is cut (a.k.a. killed in emacs-ese) is inserted into a list of kills, called the kill ring. To paste the latest value from the kill ring (emacs calls this "yanking") use :kbd:`Control`\ +\ :kbd:`Y` (the ``yank`` input function). After pasting, use :kbd:`Alt`\ +\ :kbd:`Y` (``yank-pop``) to rotate to the previous kill.
Copy and paste from outside are also supported, both via the :kbd:`Control`\ +\ :kbd:`X` / :kbd:`Control`\ +\ :kbd:`V` bindings (the ``fish_clipboard_copy`` and ``fish_clipboard_paste`` functions [#]_) and via the terminal's paste function, for which fish enables "Bracketed Paste Mode", so it can tell a paste from manually entered text.
In addition, when pasting inside single quotes, pasted single quotes and backslashes are automatically escaped so that the result can be used as a single token simply by closing the quote after.
Kill ring entries are stored in ``fish_killring`` variable.
.. [#] These rely on external tools. Currently xsel, xclip, wl-copy/wl-paste and pbcopy/pbpaste are supported.
.. _multiline:
Multiline editing
-----------------
The fish commandline editor can be used to work on commands that are several lines long. There are three ways to make a command span more than a single line:
- Pressing the :kbd:`Enter` key while a block of commands is unclosed, such as when one or more block commands such as ``for``, ``begin`` or ``if`` do not have a corresponding :ref:`end <cmd-end>` command.
- Pressing :kbd:`Alt`\ +\ :kbd:`Enter` instead of pressing the :kbd:`Enter` key.
- By inserting a backslash (``\``) character before pressing the :kbd:`Enter` key, escaping the newline.
The fish commandline editor works exactly the same in single line mode and in multiline mode. To move between lines use the left and right arrow keys and other such keyboard shortcuts.
.. _history-search:
Searchable command history
--------------------------
After a command has been executed, it is remembered in the history list. Any duplicate history items are automatically removed. By pressing the up and down keys, you can search forwards and backwards in the history. If the current command line is not empty when starting a history search, only the commands containing the string entered into the command line are shown.
By pressing :kbd:`Alt`\ +\ :kbd:`↑` and :kbd:`Alt`\ +\ :kbd:`↓`, a history search is also performed, but instead of searching for a complete commandline, each commandline is broken into separate elements just like it would be before execution, and the history is searched for an element matching that under the cursor.
History searches are case-insensitive unless the search string contains an uppercase character, and they can be aborted by pressing the escape key.
Prefixing the commandline with a space will prevent the entire line from being stored in the history.
The command history is stored in the file ``~/.local/share/fish/fish_history`` (or
``$XDG_DATA_HOME/fish/fish_history`` if that variable is set) by default. However, you can set the
``fish_history`` environment variable to change the name of the history session (resulting in a
``<session>_history`` file); both before starting the shell and while the shell is running.
See the :ref:`history <cmd-history>` command for other manipulations.
Examples:
To search for previous entries containing the word 'make', type ``make`` in the console and press the up key.
If the commandline reads ``cd m``, place the cursor over the ``m`` character and press :kbd:`Alt`\ +\ :kbd:`↑` to search for previously typed words containing 'm'.
Navigating directories
----------------------
.. _directory-history:
The current working directory can be displayed with the :ref:`pwd <cmd-pwd>` command, or the ``$PWD`` :ref:`special variable <variables-special>`.
Directory history
-----------------
Fish automatically keeps a trail of the recent visited directories with :ref:`cd <cmd-cd>` by storing this history in the ``dirprev`` and ``dirnext`` variables.
Several commands are provided to interact with this directory history:
- :ref:`dirh <cmd-dirh>` prints the history
- :ref:`cdh <cmd-cdh>` displays a prompt to quickly navigate the history
- :ref:`prevd <cmd-prevd>` moves backward through the history. It is bound to :kbd:`Alt`\ +\ :kbd:`←`
- :ref:`nextd <cmd-nextd>` moves forward through the history. It is bound to :kbd:`Alt`\ +\ :kbd:`→`
.. _directory-stack:
Directory stack
---------------
Another set of commands, usually also available in other shells like bash, deal with the directory stack. Stack handling is not automatic and needs explicit calls of the following commands:
- :ref:`dirs <cmd-dirs>` prints the stack
- :ref:`pushd <cmd-pushd>` adds a directory on top of the stack and makes it the current working directory
- :ref:`popd <cmd-popd>` removes the directory on top of the stack and changes the current working directory

1452
doc_src/language.rst Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ License
License for fish
----------------
``fish`` Copyright © 2005-2009 Axel Liljencrantz, 2009-2020 fish-shell contributors. ``fish`` is released under the GNU General Public License, version 2.
``fish`` Copyright © 2005-2009 Axel Liljencrantz, 2009-2021 fish-shell contributors. ``fish`` is released under the GNU General Public License, version 2.
``fish`` includes other code licensed under the GNU General Public License, version 2, including GNU ``printf``.

View File

@@ -4,7 +4,7 @@
{% block rootrellink %}
<li><img src="{{ pathto('_static/' + theme_root_icon, 1) }}" alt=""
style="width: 80px; vertical-align: middle; margin-top: -1px"/></li>
style="width: 80px; height: 80px; vertical-align: middle; margin-top: -1px"/></li>
<li><a href="{{theme_root_url}}">{{theme_root_name}}</a>{{ reldelim1 }}</li>
{% if theme_root_include_title %}
<a href="{{ pathto('index') }}">{{ shorttitle }}</a>{{ reldelim1 }}
@@ -37,7 +37,8 @@
{%- endif %}
{% endblock %}
{% block sidebar1 %}{{ sidebar() }}{% endblock %}
{# The sidebar goes into the *document* block, so it ends up in the document *div* so it doesn't go over the footer #}
{% block document %}{{ sidebar() }}{{ super() }}{% endblock %}
{% block sidebar2 %} {% endblock %}
{% block extrahead %}
<link rel="shortcut icon" type="image/png" href="{{ pathto('_static/' + theme_root_icon, 1) }}" />

View File

@@ -1,7 +1,12 @@
@import url("classic.css");
:root {
color-scheme: light dark; /* both supported */
}
html {
background: none;
min-height: 100%;
}
body {
@@ -26,6 +31,7 @@ div.related {
padding: 0.5em 0;
border-top: 1px solid #ccc;
margin-top: 0;
background-color: inherit;
}
div.section {
@@ -34,9 +40,15 @@ div.section {
but I have no idea how to make the tables themselves scrollable
*/
overflow-y: auto;
/* This avoids leaving the actual text narrower than necessary
in certain widths.
*/
width: 100%;
}
div.related a:hover {
div.related a:hover,
div.footer a:hover,
div.sphinxsidebar a:hover {
color: #0095C4;
}
@@ -56,17 +68,41 @@ form.inline-search input[type="submit"] {
}
div.sphinxsidebar {
background-color: #eeeefa;
border-right: 1px solid #ccc;
border-radius: 0px;
line-height: 130%;
line-height: 150%;
font-size: smaller;
overflow: auto;
position: absolute;
margin-left: 0;
float: left;
/* Let this move along with the screen, but be scrollable itself.
This means the user can't scroll *away* from the sidebar - it's always available */
overflow: auto;
position: sticky;
top: 0;
max-height: 100vh;
/* Default scrollbar is too thicc */
scrollbar-width: thin;
}
div.sphinxsidebar::-webkit-scrollbar {
width: 5px;
}
div.sphinxsidebar::-webkit-scrollbar-thumb {
/* Without, chrome lets the scrollbar disappear? */
background-color: grey;
border-radius: 10px;
}
div.documentwrapper {
float: none;
}
div.document, div.body {
background-color: inherit;
color: inherit;
}
div#searchbox {
/* Cheesy: The padding is on the sphinxsidebar*wrapper*,
so if this is the last element the bottom padding won't apply.
@@ -75,7 +111,7 @@ div#searchbox {
}
div.sphinxsidebar h3, div.sphinxsidebar h4 {
margin-top: 1.5em;
margin-top: 1em;
}
div.sphinxsidebarwrapper > h3:first-child {
@@ -86,8 +122,8 @@ div.sphinxsidebarwrapper > ul > li > ul > li {
margin-bottom: 0.4em;
}
div.sphinxsidebar a:hover {
color: #0095C4;
ul li.toctree-l1 {
line-height: 150%;
}
form.inline-search input,
@@ -103,7 +139,7 @@ div.sphinxsidebar input[type=text] {
}
div.body {
padding: 0 0 0 1.2em;
padding: 10px 0 0 1.2em;
min-width: 150px;
}
@@ -155,8 +191,13 @@ div.body a:hover {
tt, code, pre {
font-family: monospace, sans-serif;
font-size: 96.5%;
/* Older sphinx versions set a color here, we need to unset it so we inherit from the outer div.highlight */
background-color: unset;
/* Older sphinx versions set a color here, we need to inherit it from the outer div.highlight */
background-color: inherit;
}
pre, div[class*="highlight-"] {
/* For some reason sphinx since 3.1.2 sets "clear: both" here, which breaks in interesting ways */
clear: unset;
}
div.body tt, div.body code {
@@ -213,10 +254,6 @@ div.footer {
margin-right: 10px;
}
div.footer a:hover {
color: #0095C4;
}
.refcount {
color: #060;
}
@@ -226,7 +263,7 @@ div.footer a:hover {
}
.highlight {
background: #FFF !important;
background: #FFF;
}
dl > dt span ~ em {
@@ -237,10 +274,15 @@ dl > dt span ~ em {
- the sidebar, the gradient background, ... */
@media screen and (max-width: 700px) {
div.sphinxsidebar {
font-size: 16px;
width: 100%;
height: auto;
position: relative;
}
div.documentwrapper {
float: left;
}
div.sphinxsidebar ul {
flex-basis: content;
flex-wrap: wrap;
@@ -304,3 +346,82 @@ kbd {
color: #000;
padding: 0.1em 0.3em;
}
.footnote, .footnote-reference {
background-color: #ddddea;
font-size: 90%;
}
@media (prefers-color-scheme: dark) {
body {
background: linear-gradient(to top, #1f1f3f 0%,#051f3a 100%);
}
div#fmain {
color: #DDD;
background-color: #202028;
box-shadow: 0 0 5px 1px #000;
}
div.body h1, div.body h2, div.body h3, div.body h4, div.body h5, div.body h6 {
background-color: inherit;
color: inherit;
}
.footnote, .footnote-reference {
background-color: #101020;
}
div.sphinxsidebar {
border-right: 1px solid #666;
}
div.related:first-child {
border-bottom: 1px solid #666;
}
div.related {
border-top: 1px solid #666;
}
div.sphinxsidebar a, div.footer {
color: #CCC;
}
div.sphinxsidebar h3 a, div.related a, div.sphinxsidebar h3 {
color: #AAA;
}
.highlight {
background: #000;
}
kbd {
background-color: #111;
border: 1px solid #444;
box-shadow: 0.1em 0.1em 0.2em rgba(100,100,100,0.1);
color: #FFF;
}
table.docutils th {
background-color: #222;
}
table.docutils td {
background-color: #111;
}
input {
background-color: #222;
color: #AAA;
}
div.body a {
color: #2092da;
}
dt:target, span.highlighted {
background-color: #404060;
}
table.docutils {
border: 1px solid #222;
}
table.docutils td, table.docutils th {
border: 1px solid #222 !important;
}
}

View File

@@ -1,5 +1,3 @@
@import "pydoctheme.css";
.highlight .hll { background-color: #ffffcc }
.highlight { background: #f8f8f8; }
.highlight .c { color: #8f5902; } /* Comment */

View File

@@ -268,7 +268,8 @@ var Search = {
} else {
// normal html builders
requestUrl = DOCUMENTATION_OPTIONS.URL_ROOT + item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
linkUrl = item[0] + DOCUMENTATION_OPTIONS.LINK_SUFFIX;
// If LINK_SUFFIX is undefined, default to ".html" - I actually don't see this being anything else.
linkUrl = item[0] + (DOCUMENTATION_OPTIONS.LINK_SUFFIX || ".html");
}
listItem.append($('<a/>').attr('href',
linkUrl +

View File

@@ -28,8 +28,8 @@ which means you are all set up and can start using fish::
This prompt that you see above is the fish default prompt: it shows your username, hostname, and working directory.
- to change this prompt see `how to change your prompt <#prompt>`_
- to switch to fish permanently see `switch your default shell to fish <#switching-to-fish>`_.
- to change this prompt see :ref:`how to change your prompt <prompt>`
- to switch to fish permanently see :ref:`switch your default shell to fish <switching-to-fish>`.
From now on, we'll pretend your prompt is just a ``>`` to save space.
@@ -41,6 +41,7 @@ This tutorial assumes a basic understanding of command line shells and Unix comm
If you have a strong understanding of other shells, and want to know what fish does differently, search for the magic phrase *unlike other shells*, which is used to call out important differences.
Or, if you want a quick overview over the differences to other shells like Bash, see :ref:`Fish For Bash Users <fish_for_bash_users>`.
Running Commands
----------------
@@ -51,25 +52,20 @@ Fish runs commands like other shells: you type a command, followed by its argume
hello world
This runs the command ``echo`` with the arguments ``hello`` and ``world``.
You can include a literal space in an argument with a backslash, or by using single or double quotes::
This runs the command ``echo`` with the arguments ``hello`` and ``world``. In this case that's the same as one argument ``hello world``, but in many cases it's not. If you need to pass an argument that includes a space, you can :ref:`escape <escapes>` with a backslash, or :ref:`quote <quotes>` it using single or double quotes::
> mkdir My\ Files
# Makes a directory called "My Files", with a space in the name
> cp ~/Some\ File 'My Files'
# Copies a file called "Some File" in the home directory to "My Files"
> ls "My Files"
Some File
Commands can be chained with semicolons.
Getting Help
------------
Fish has excellent help and man pages. Run ``help`` to open help in a web browser, and ``man`` to open it in a man page. You can also ask for help with a specific command, for example, ``help set`` to open in a web browser, or ``man set`` to see it in the terminal.
Run ``help`` to open fish's help in a web browser, and ``man`` with the page (like ``fish-language``) to open it in a man page. You can also ask for help with a specific command, for example, ``help set`` to open in a web browser, or ``man set`` to see it in the terminal.
::
@@ -78,7 +74,6 @@ Fish has excellent help and man pages. Run ``help`` to open help in a web browse
Synopsis...
Syntax Highlighting
-------------------
@@ -141,6 +136,7 @@ Especially powerful is the recursive wildcard ** which searches directories recu
If that directory traversal is taking a long time, you can :kbd:`Control`\ +\ :kbd:`C` out of it.
For more, see :ref:`Wildcards <expand-wildcard>`.
Pipes and Redirections
----------------------
@@ -164,6 +160,7 @@ To redirect stdout and stderr into one file, you need to first redirect stdout,
> make > make_output.txt 2>&1
For more, see :ref:`Input and output redirections <redirects>` and :ref:`Pipes <pipes>`.
Autosuggestions
---------------
@@ -233,13 +230,13 @@ Try hitting tab and see what fish can do!
Variables
---------
Like other shells, a dollar sign performs variable substitution::
Like other shells, a dollar sign followed by a variable name is replaced with the value of that variable::
> echo My home directory is $HOME
My home directory is /home/tutorial
Variable substitution also happens in double quotes, but not single quotes::
This is known as variable substitution, and it also happens in double quotes, but not single quotes::
> echo "My current directory is $PWD"
My current directory is /home/tutorial
@@ -275,6 +272,8 @@ You can erase (or "delete") a variable with ``-e`` or ``--erase``
> env | grep MyVariable
(no output)
For more, see :ref:`Variable expansion <expand-variable>`.
.. _tut-exports:
Exports (Shell Variables)
@@ -294,7 +293,9 @@ It can also be unexported with ``--unexport`` or ``-u``.
This works the other way around as well! If fish is started by something else, it inherits that parents exported variables. So if your terminal emulator starts fish, and it exports ``$LANG`` set to ``en_US.UTF-8``, fish will receive that setting. And whatever started your terminal emulator also gave *it* some variables that it will then pass on unless it specifically decides not to. This is how fish usually receives the values for things like ``$LANG``, ``$PATH`` and ``$TERM``, without you having to specify them again.
Note that exported variables can be local or global or universal - "exported" is not a :ref:`scope <variables-scope>`. Usually you'd make them global via ``set -gx MyVariable SomeValue``.
Exported variables can be local or global or universal - "exported" is not a :ref:`scope <variables-scope>`! Usually you'd make them global via ``set -gx MyVariable SomeValue``.
For more, see :ref:`Exporting variables <variables-export>`.
.. _tut-lists:
@@ -310,7 +311,6 @@ Other variables, like ``$PATH``, really do have multiple values. During variable
> echo $PATH
/usr/bin /bin /usr/sbin /sbin /usr/local/bin
Variables whose name ends in "PATH" are automatically split on colons to become lists. They are joined using colons when exported to subcommands. This is for compatibility with other tools, which expect $PATH to use colons. You can also explicitly add this quirk to a variable with ``set --path``, or remove it with ``set --unpath``.
Lists cannot contain other lists: there is no recursion. A variable is a list of strings, full stop.
@@ -320,13 +320,10 @@ Get the length of a list with ``count``::
> count $PATH
5
You can append (or prepend) to a list by setting the list to itself, with some additional arguments. Here we append /usr/local/bin to $PATH::
> set PATH $PATH /usr/local/bin
You can access individual elements with square brackets. Indexing starts at 1 from the beginning, and -1 from the end::
> echo $PATH
@@ -336,11 +333,8 @@ You can access individual elements with square brackets. Indexing starts at 1 fr
> echo $PATH[-1]
/usr/local/bin
You can also access ranges of elements, known as "slices":
::
> echo $PATH[1..2]
@@ -348,7 +342,6 @@ You can also access ranges of elements, known as "slices":
> echo $PATH[-1..2]
/usr/local/bin /sbin /usr/sbin /bin
You can iterate over a list (or a slice) with a for loop::
> for val in $PATH
@@ -360,7 +353,6 @@ You can iterate over a list (or a slice) with a for loop::
entry: /sbin
entry: /usr/local/bin
Lists adjacent to other lists or strings are expanded as :ref:`cartesian products <cartesian-product>` unless quoted (see :ref:`Variable expansion <expand-variable>`)::
> set a 1 2 3
@@ -372,8 +364,10 @@ Lists adjacent to other lists or strings are expanded as :ref:`cartesian product
> echo "$a banana"
1 2 3 banana
This is similar to :ref:`Brace expansion <expand-brace>`.
For more, see :ref:`Lists <variables-lists>`.
This is similar to `Brace expansion <index#expand-brace>`__.
Command Substitutions
---------------------
@@ -383,24 +377,20 @@ Command substitutions use the output of one command as an argument to another. U
> echo In (pwd), running (uname)
In /home/tutorial, running FreeBSD
A common idiom is to capture the output of a command in a variable::
> set os (uname)
> echo $os
Linux
Command substitutions are not expanded within quotes. Instead, you can temporarily close the quotes, add the command substitution, and reopen them, all in the same argument::
> touch "testing_"(date +%s)".txt"
> ls *.txt
testing_1360099791.txt
Unlike other shells, fish does not split command substitutions on any whitespace (like spaces or tabs), only newlines. This can be an issue with commands like ``pkg-config`` that print what is meant to be multiple arguments on a single line. To split it on spaces too, use ``string split``.
::
> printf '%s\n' (pkg-config --libs gio-2.0)
@@ -410,6 +400,16 @@ Unlike other shells, fish does not split command substitutions on any whitespace
-lgobject-2.0
-lglib-2.0
If you need a command substitutions output as one argument, without any splits, use ``string collect``::
> echo "first line
second line" > myfile
> set myfile (cat myfile | string collect)
> printf '|%s|' $myfile
|first line
second line|
For more, see :ref:`Command substitution <expand-command-substitution>`.
.. _tut-semicolon:
@@ -441,11 +441,12 @@ Unlike other shells, fish stores the exit status of the last command in ``$statu
> echo $status
1
This indicates how the command fared - 0 usually means success, while the others signify kinds of failure. For instance fish's ``set --query`` returns the number of variables it queried that weren't set - ``set --query PATH`` usually returns 0, ``set --query arglbargl boogagoogoo`` usually returns 2.
There is also a ``$pipestatus`` list variable for the exit statuses [#]_ of processes in a pipe.
For more, see :ref:`The status variable <variables-status>`.
.. [#] or "stati" if you prefer, or "statūs" if you've time-travelled from ancient Rome or work as a latin teacher
.. _tut-combiners:
@@ -542,9 +543,9 @@ There is also a :ref:`switch <cmd-switch>` command::
echo Hi, stranger!
end
As you see, :ref:`case <cmd-case>` does not fall through, and can accept multiple arguments or (quoted) wildcards.
Note that :ref:`case <cmd-case>` does not fall through, and can accept multiple arguments or (quoted) wildcards.
For more, see :ref:`Conditions <syntax-conditional>`.
Functions
---------
@@ -575,6 +576,8 @@ You can see the source for any function by passing its name to ``functions``::
command ls -G $argv
end
For more, see :ref:`Functions <syntax-function>`.
.. [#] There is a function called :ref:`alias <cmd-alias>`, but it's just a shortcut to make functions.
Loops
@@ -604,6 +607,7 @@ Iterating over a list of numbers can be done with ``seq``::
touch file_$x.txt
end
For more, see :ref:`Loops and blocks <syntax-loops-and-blocks>`.
Prompt
------
@@ -642,7 +646,7 @@ This prompt would look like:
:red:`/home/tutorial >` _
You can choose among some sample prompts by running ``fish_config prompt``.
You can choose among some sample prompts by running ``fish_config`` for a web UI or ``fish_config prompt`` for a simpler version inside your terminal.
$PATH
-----
@@ -702,7 +706,7 @@ It is possible to directly create functions and variables in ``config.fish`` fil
However, it is more common and efficient to use autoloading functions and universal variables.
If you want to organize your configuration, fish also reads commands in .fish files in ``~/.config/fish/conf.d/``. See :ref:`initialization <initialization>` for the details.
If you want to organize your configuration, fish also reads commands in .fish files in ``~/.config/fish/conf.d/``. See :ref:`Configuration Files <configuration>` for the details.
Autoloading Functions
---------------------

27
docker/alpine.Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM alpine:3.13
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN apk add bash cmake g++ gettext-dev git libintl musl-dev ncurses-dev ninja python3 py3-pexpect
RUN addgroup -g 1000 fishuser
RUN adduser \
--disabled-password \
--gecos "" \
--home "/home/fishuser" \
--ingroup fishuser \
--uid 1000 \
fishuser
RUN mkdir -p /home/fishuser/fish-build \
&& mkdir /fish-source \
&& chown -R fishuser:fishuser /home/fishuser /fish-source
USER fishuser
WORKDIR /home/fishuser
COPY fish_run_tests.sh /
CMD /fish_run_tests.sh

31
docker/centos8.Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM centos:8
# install powertools to get ninja-build
RUN dnf -y install dnf-plugins-core \
&& dnf config-manager --set-enabled powertools \
&& yum install --assumeyes epel-release \
&& yum install --assumeyes \
cmake \
diffutils \
gcc-c++ \
git \
ncurses-devel \
ninja-build \
python3 \
openssl \
sudo
RUN pip3 install pexpect
RUN groupadd -g 1000 fishuser \
&& useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser -G wheel \
&& mkdir -p /home/fishuser/fish-build \
&& mkdir /fish-source \
&& chown -R fishuser:fishuser /home/fishuser /fish-source
USER fishuser
WORKDIR /home/fishuser
COPY fish_run_tests.sh /
CMD /fish_run_tests.sh

View File

@@ -16,7 +16,7 @@ DOCKER_EXTRA_ARGS=""
set -e
# Get fish source directory.
FISH_SRC_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )"/.. && pwd)
FISH_SRC_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )"/.. >/dev/null && pwd)
# Parse args.
while [ $# -gt 1 ]; do

27
docker/fedora.Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
FROM fedora:latest
RUN dnf install --assumeyes \
cmake \
gcc-c++ \
git-core \
ncurses-devel \
ninja-build \
python3 \
python3-pip \
openssl \
sudo
RUN pip3 install pexpect
RUN groupadd -g 1000 fishuser \
&& useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser -G wheel \
&& mkdir -p /home/fishuser/fish-build \
&& mkdir /fish-source \
&& chown -R fishuser:fishuser /home/fishuser /fish-source
USER fishuser
WORKDIR /home/fishuser
COPY fish_run_tests.sh /
CMD /fish_run_tests.sh

36
docker/xenial.Dockerfile Normal file
View File

@@ -0,0 +1,36 @@
FROM ubuntu:16.04
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN apt-get update \
&& apt-get -y install \
build-essential \
cmake \
gettext \
git \
libncurses5-dev \
locales \
ninja-build \
python3 \
python3-pip \
sudo \
&& locale-gen en_US.UTF-8
# The python3-pexpect package on Xenial doesn't allow delaybeforesend to be None.
# Install pexpect with pip which is newer.
RUN pip3 install pexpect
RUN groupadd -g 1000 fishuser \
&& useradd -p $(openssl passwd -1 fish) -d /home/fishuser -m -u 1000 -g 1000 fishuser \
&& adduser fishuser sudo \
&& mkdir -p /home/fishuser/fish-build \
&& mkdir /fish-source \
&& chown -R fishuser:fishuser /home/fishuser /fish-source
USER fishuser
WORKDIR /home/fishuser
COPY fish_run_tests.sh /
CMD /fish_run_tests.sh

View File

@@ -1,5 +1,4 @@
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true

View File

@@ -21,18 +21,12 @@ BuildRequires: cmake pcre2-devel
BuildRequires: update-desktop-files
%endif
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
BuildRequires: gcc48 gcc48-c++
%endif
# for tests
%if 0%{?fedora} || ( 0%{?rhel} && 0%{?rhel} > 7 )
# Need the en_US.utf-8 locale at a minimum
BuildRequires: glibc-langpack-en
%endif
%if 0%{?rhel} != 6
BuildRequires: python3 procps
%endif
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -59,11 +53,6 @@ is simple but incompatible with other shell languages.
%setup -q -n %{name}-@VERSION@
%build
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
export CC=gcc48
export CXX=g++48
EXTRA_CMAKE_FLAGS="-DCURSES_EXTRA_LIBRARY=tinfo"
%endif
# CMake macros define -DBUILD_SHARED_LIBS:BOOL=ON, which breaks the
# bundled PCRE2 static library.
EXTRA_CMAKE_FLAGS="$EXTRA_CMAKE_FLAGS -DBUILD_SHARED_LIBS:BOOL=OFF"
@@ -99,12 +88,7 @@ cp -a CONTRIBUTING.rst %{buildroot}%{_datadir}/doc/fish/
%if 0%{?__builddir:1}
cd %__builddir
%endif
# Turn off tests on RHEL 6, they are hard to keep running
%if 0%{?opensuse_bs} && 0%{?rhel} && 0%{?rhel} < 7
./fish -c 'exit 0'
%else
make test SHOW_INTERACTIVE_LOG=1
%endif
%clean
rm -rf $RPM_BUILD_ROOT

View File

@@ -66,7 +66,7 @@ complete -f -n '__fish_bundle_using_command update' -c bundle -s g -l group -d '
complete -f -n '__fish_bundle_using_command update' -c bundle -a '(__fish_bundled_gems)'
# Package
complete -f -n __fish_bundle_no_command -c bundle -a package -d 'Package the .gem files required by your application into the vendor/cache directory'
complete -f -n __fish_bundle_no_command -c bundle -a package -d 'Package the .gem files into vendor/cache directory'
# Binstubs
complete -f -n __fish_bundle_no_command -c bundle -a binstubs -d 'Install the binstubs of the listed gem'
@@ -102,7 +102,7 @@ complete -f -n '__fish_bundle_using_command help' -c bundle -a cleanup -d 'Clean
##
# Check
complete -f -n __fish_bundle_no_command -c bundle -a check -d 'Determine whether the requirements for your application are installed and available to bundler'
complete -f -n __fish_bundle_no_command -c bundle -a check -d 'Check if the requirements are installed and available to bundler'
complete -f -n '__fish_bundle_using_command check' -c bundle -l gemfile -d 'The location of the Gemfile bundler should use'
complete -f -n '__fish_bundle_using_command check' -c bundle -l path -d 'Specify a path other than the system default (BUNDLE_PATH or GEM_HOME)'
complete -f -n '__fish_bundle_using_command check' -c bundle -l dry-run -d 'Lock the Gemfile'

View File

@@ -1,30 +1,11 @@
# Tab completion for cargo (https://github.com/rust-lang/cargo).
complete -c cargo -s h -l help
complete -c cargo -s V -l version -d 'Print version info and exit'
complete -c cargo -l list -d 'List installed commands'
complete -c cargo -s v -l verbose -d 'Use verbose output'
complete -c cargo -s q -l quiet -d 'No output printed to stdout'
## --- WRITTEN MANUALLY ---
set -l __fish_cargo_subcommands (cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s+(.*)' '$1\t$2' | string escape)
complete -c cargo -f -c cargo -n __fish_use_subcommand -a "$__fish_cargo_subcommands"
complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a "$__fish_cargo_subcommands"
for x in bench b build clean doc fetch generate-lockfile \
locate-project package pkgid publish \
read-manifest r run rustc t test update \
verify-project
complete -c cargo -r -n "__fish_seen_subcommand_from $x" -l manifest-path -d 'path to the manifest to compile'
end
for x in bench b build clean doc rustc t test update
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -s p -l spec -d 'Package to build'
end
for x in bench b build clean doc r run rustc t test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l target -d 'Build for the target triple'
end
for x in bench b build rustc t test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -a "(cargo bench --bench 2>&1 | string replace -rf '^\s+' '')"
complete -c cargo -n "__fish_seen_subcommand_from $x" -l lib -d 'Only this package\'s library'
@@ -36,7 +17,7 @@ function __list_cargo_examples
return
end
find ./examples/ -mindepth 1 -maxdepth 1 -type f -name "*.rs" -or -type d \
find ./examples -mindepth 1 -maxdepth 1 -type f -name "*.rs" -or -type d \
| string replace -r './examples/(.*?)(?:.rs)?$' '$1'
end
for x in bench b build r run rustc t test
@@ -44,59 +25,786 @@ for x in bench b build r run rustc t test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -a "(__list_cargo_examples)"
end
for x in b build r run rustc t test
complete -c cargo -n "__fish_seen_subcommand_from $x" -l release -d 'Build artifacts in release mode, with optimizations'
end
for x in bench t test
complete -c cargo -n "__fish_seen_subcommand_from $x" -l no-run -d 'Compile but do not run'
end
for x in bench b build doc r run rustc t test
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -s j -l jobs -d 'Number of jobs to run in parallel'
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l features -d 'Space-separated list of features to also build'
complete -c cargo -n "__fish_seen_subcommand_from $x" -l no-default-features -d 'Do not build the `default` feature'
end
complete -c cargo -n '__fish_seen_subcommand_from doc' -l no-deps -d 'Don\'t build documentation for dependencies'
complete -c cargo -x -n '__fish_seen_subcommand_from new' -l vcs -a 'none hg git' -d 'Specify a vcs to use'
complete -c cargo -x -n '__fish_seen_subcommand_from new' -l name
# This bin does not take any arguments which is why it is not defined above.
complete -c cargo -n '__fish_seen_subcommand_from new' -l bin
complete -c cargo -x -n '__fish_seen_subcommand_from git-checkout' -l url
complete -c cargo -x -n '__fish_seen_subcommand_from git-checkout' -l reference
for x in login publish search
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l host -d 'The host to submit the request to'
end
complete -c cargo -n '__fish_seen_subcommand_from doc' -l open -d 'Opens the docs in a browser after the operation'
complete -c cargo -r -n '__fish_seen_subcommand_from owner' -s a -l add -d 'Login of a user to add as an owner'
complete -c cargo -r -n '__fish_seen_subcommand_from owner' -s r -l remove -d 'Login of a user to remove as an owner'
for x in owner yank
complete -c cargo -r -n "__fish_seen_subcommand_from $x" -l index -d 'Registry index to use'
end
for x in owner publish yank
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l token -d 'API token to use when authenticating'
end
complete -c cargo -n '__fish_seen_subcommand_from package' -l no-verify -d 'Don\'t verify the contents by building them'
complete -c cargo -n '__fish_seen_subcommand_from package' -l no-metadata -d 'Ignore warnings about a lack of human-usable metadata'
complete -c cargo -n '__fish_seen_subcommand_from update' -l aggressive -d 'Force updating all dependencies of <name> as well'
complete -c cargo -x -n '__fish_seen_subcommand_from update' -l precise -d 'Update a single dependency to exactly PRECISE'
complete -c cargo -x -n '__fish_seen_subcommand_from yank' -l vers -d 'The version to yank or un-yank'
complete -c cargo -n '__fish_seen_subcommand_from yank' -l undo -d 'Undo a yank, putting a version back into the index'
function __fish_cargo_packages
find . -name Cargo.toml | string replace -rf '.*/([^/]+)/?Cargo.toml' '$1'
end
complete -c cargo -n '__fish_seen_subcommand_from run test build debug check' -l package \
-xa "(__fish_cargo_packages)"
## --- AUTO-GENERATED WITH `cargo complete fish` ---
complete -c cargo -n __fish_use_subcommand -l explain -d 'Run `rustc --explain CODE`'
complete -c cargo -n __fish_use_subcommand -l color -d 'Coloring: auto, always, never'
complete -c cargo -n __fish_use_subcommand -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n __fish_use_subcommand -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n __fish_use_subcommand -s V -l version -d 'Print version info and exit'
complete -c cargo -n __fish_use_subcommand -l list -d 'List installed commands'
complete -c cargo -n __fish_use_subcommand -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n __fish_use_subcommand -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n __fish_use_subcommand -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n __fish_use_subcommand -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n __fish_use_subcommand -l offline -d 'Run without accessing the network'
complete -c cargo -n __fish_use_subcommand -s h -l help -d 'Prints help information'
complete -c cargo -n __fish_use_subcommand -f -a bench -d 'Execute all benchmarks of a local package'
complete -c cargo -n __fish_use_subcommand -f -a build -d 'Compile a local package and all of its dependencies'
complete -c cargo -n __fish_use_subcommand -f -a check -d 'Check a local package and all of its dependencies for errors'
complete -c cargo -n __fish_use_subcommand -f -a clean -d 'Remove artifacts that cargo has generated in the past'
complete -c cargo -n __fish_use_subcommand -f -a complete -d 'Generate completion file for a shell'
complete -c cargo -n __fish_use_subcommand -f -a describe-future-incompatibilities -d 'Reports any crates which will eventually stop compiling'
complete -c cargo -n __fish_use_subcommand -f -a doc -d 'Build a package\'s documentation'
complete -c cargo -n __fish_use_subcommand -f -a fetch -d 'Fetch dependencies of a package from the network'
complete -c cargo -n __fish_use_subcommand -f -a fix -d 'Automatically fix lint warnings reported by rustc'
complete -c cargo -n __fish_use_subcommand -f -a generate-lockfile -d 'Generate the lockfile for a package'
complete -c cargo -n __fish_use_subcommand -f -a git-checkout -d 'This subcommand has been removed'
complete -c cargo -n __fish_use_subcommand -f -a init -d 'Create a new cargo package in an existing directory'
complete -c cargo -n __fish_use_subcommand -f -a install -d 'Install a Rust binary. Default location is $HOME/.cargo/bin'
complete -c cargo -n __fish_use_subcommand -f -a locate-project -d 'Print a JSON representation of a Cargo.toml file\'s location'
complete -c cargo -n __fish_use_subcommand -f -a login -d 'Save an api token from the registry locally. If token is not specified, it will be read from stdin.'
complete -c cargo -n __fish_use_subcommand -f -a logout -d 'Remove an API token from the registry locally'
complete -c cargo -n __fish_use_subcommand -f -a metadata -d 'Output the resolved dependencies of a package, the concrete used versions including overrides, in machine-readable format'
complete -c cargo -n __fish_use_subcommand -f -a new -d 'Create a new cargo package at <path>'
complete -c cargo -n __fish_use_subcommand -f -a owner -d 'Manage the owners of a crate on the registry'
complete -c cargo -n __fish_use_subcommand -f -a package -d 'Assemble the local package into a distributable tarball'
complete -c cargo -n __fish_use_subcommand -f -a pkgid -d 'Print a fully qualified package specification'
complete -c cargo -n __fish_use_subcommand -f -a publish -d 'Upload a package to the registry'
complete -c cargo -n __fish_use_subcommand -f -a read-manifest -d 'Print a JSON representation of a Cargo.toml manifest.
Deprecated, use `cargo metadata --no-deps` instead.'
complete -c cargo -n __fish_use_subcommand -f -a run -d 'Run a binary or example of the local package'
complete -c cargo -n __fish_use_subcommand -f -a rustc -d 'Compile a package, and pass extra options to the compiler'
complete -c cargo -n __fish_use_subcommand -f -a rustdoc -d 'Build a package\'s documentation, using specified custom flags.'
complete -c cargo -n __fish_use_subcommand -f -a search -d 'Search packages in crates.io'
complete -c cargo -n __fish_use_subcommand -f -a test -d 'Execute all unit and integration tests and build examples of a local package'
complete -c cargo -n __fish_use_subcommand -f -a tree -d 'Display a tree visualization of a dependency graph'
complete -c cargo -n __fish_use_subcommand -f -a uninstall -d 'Remove a Rust binary'
complete -c cargo -n __fish_use_subcommand -f -a update -d 'Update dependencies as recorded in the local lock file'
complete -c cargo -n __fish_use_subcommand -f -a vendor -d 'Vendor all dependencies for a project locally'
complete -c cargo -n __fish_use_subcommand -f -a verify-project -d 'Check correctness of crate manifest'
complete -c cargo -n __fish_use_subcommand -f -a version -d 'Show version information'
complete -c cargo -n __fish_use_subcommand -f -a yank -d 'Remove a pushed crate from the index'
complete -c cargo -n __fish_use_subcommand -f -a help -d 'Prints this message or the help of the given subcommand(s)'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l bin -d 'Benchmark only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l example -d 'Benchmark only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l test -d 'Benchmark only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l bench -d 'Benchmark only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s p -l package -d 'Package to run benchmarks for'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l exclude -d 'Exclude packages from the benchmark'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l lib -d 'Benchmark only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l bins -d 'Benchmark all binaries'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l examples -d 'Benchmark all examples'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l tests -d 'Benchmark all tests'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l benches -d 'Benchmark all benches'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l all-targets -d 'Benchmark all targets'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l no-run -d 'Compile, but don\'t run benchmarks'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l all -d 'Alias for --workspace (deprecated)'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l workspace -d 'Benchmark all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l no-fail-fast -d 'Run all benchmarks regardless of failure'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from bench" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from bench" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from build" -s p -l package -d 'Package to build (see `cargo help pkgid`)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l exclude -d 'Exclude packages from the build'
complete -c cargo -n "__fish_seen_subcommand_from build" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from build" -l bin -d 'Build only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from build" -l example -d 'Build only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from build" -l test -d 'Build only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from build" -l bench -d 'Build only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from build" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from build" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from build" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from build" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from build" -l out-dir -d 'Copy final artifacts to this directory (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from build" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from build" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from build" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from build" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from build" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from build" -l all -d 'Alias for --workspace (deprecated)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l workspace -d 'Build all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from build" -l lib -d 'Build only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from build" -l bins -d 'Build all binaries'
complete -c cargo -n "__fish_seen_subcommand_from build" -l examples -d 'Build all examples'
complete -c cargo -n "__fish_seen_subcommand_from build" -l tests -d 'Build all tests'
complete -c cargo -n "__fish_seen_subcommand_from build" -l benches -d 'Build all benches'
complete -c cargo -n "__fish_seen_subcommand_from build" -l all-targets -d 'Build all targets'
complete -c cargo -n "__fish_seen_subcommand_from build" -l release -d 'Build artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from build" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from build" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from build" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l build-plan -d 'Output the build plan in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from build" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from build" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from build" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from build" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from build" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from build" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from check" -s p -l package -d 'Package(s) to check'
complete -c cargo -n "__fish_seen_subcommand_from check" -l exclude -d 'Exclude packages from the check'
complete -c cargo -n "__fish_seen_subcommand_from check" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from check" -l bin -d 'Check only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from check" -l example -d 'Check only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from check" -l test -d 'Check only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from check" -l bench -d 'Check only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from check" -l profile -d 'Check artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from check" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from check" -l target -d 'Check for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from check" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from check" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from check" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from check" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from check" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from check" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from check" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from check" -l all -d 'Alias for --workspace (deprecated)'
complete -c cargo -n "__fish_seen_subcommand_from check" -l workspace -d 'Check all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from check" -l lib -d 'Check only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from check" -l bins -d 'Check all binaries'
complete -c cargo -n "__fish_seen_subcommand_from check" -l examples -d 'Check all examples'
complete -c cargo -n "__fish_seen_subcommand_from check" -l tests -d 'Check all tests'
complete -c cargo -n "__fish_seen_subcommand_from check" -l benches -d 'Check all benches'
complete -c cargo -n "__fish_seen_subcommand_from check" -l all-targets -d 'Check all targets'
complete -c cargo -n "__fish_seen_subcommand_from check" -l release -d 'Check artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from check" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from check" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from check" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from check" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from check" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from check" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from check" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from check" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from check" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from check" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from check" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from clean" -s p -l package -d 'Package to clean artifacts for'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l target -d 'Target triple to clean output for'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l profile -d 'Clean artifacts of the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from clean" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from clean" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l release -d 'Whether or not to clean release artifacts'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l doc -d 'Whether or not to clean just the documentation directory'
complete -c cargo -n "__fish_seen_subcommand_from clean" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from clean" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from clean" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from clean" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from complete" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from complete" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from complete" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from complete" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from complete" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from complete" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from complete" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from complete" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from complete" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l id -d 'identifier of the report [generated by a Cargo command invocation'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from describe-future-incompatibilities" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s p -l package -d 'Package to document'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l exclude -d 'Exclude packages from the build'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l bin -d 'Document only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l open -d 'Opens the docs in a browser after the operation'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l all -d 'Alias for --workspace (deprecated)'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l workspace -d 'Document all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l no-deps -d 'Don\'t build documentation for dependencies'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l document-private-items -d 'Document private items'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l lib -d 'Document only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l bins -d 'Document all binaries'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l release -d 'Build artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from doc" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from doc" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l target -d 'Fetch dependencies for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from fetch" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s p -l package -d 'Package(s) to fix'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l exclude -d 'Exclude packages from the fixes'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l bin -d 'Fix only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l example -d 'Fix only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l test -d 'Fix only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l bench -d 'Fix only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l target -d 'Fix for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l all -d 'Alias for --workspace (deprecated)'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l workspace -d 'Fix all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l lib -d 'Fix only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l bins -d 'Fix all binaries'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l examples -d 'Fix all examples'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l tests -d 'Fix all tests'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l benches -d 'Fix all benches'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l all-targets -d 'Fix all targets (default)'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l release -d 'Fix artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l broken-code -d 'Fix code even if it already has compiler errors'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l edition -d 'Fix in preparation for the next edition'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l edition-idioms -d 'Fix warnings to migrate to the idioms of an edition'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l allow-no-vcs -d 'Fix code even if a VCS was not detected'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l allow-dirty -d 'Fix code even if the working directory is dirty'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l allow-staged -d 'Fix code even if the working directory has staged changes'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from fix" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from fix" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from generate-lockfile" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from init" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from init" -l vcs -d 'Initialize a new repository for the given version control system (git, hg, pijul, or fossil) or do not initialize any version control at all (none), overriding a global configuration.' -r -f -a "git hg pijul fossil none"
complete -c cargo -n "__fish_seen_subcommand_from init" -l edition -d 'Edition to set for the crate generated' -r -f -a "2015 2018 2021"
complete -c cargo -n "__fish_seen_subcommand_from init" -l name -d 'Set the resulting package name, defaults to the directory name'
complete -c cargo -n "__fish_seen_subcommand_from init" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from init" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from init" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from init" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from init" -l bin -d 'Use a binary (application) template [default]'
complete -c cargo -n "__fish_seen_subcommand_from init" -l lib -d 'Use a library template'
complete -c cargo -n "__fish_seen_subcommand_from init" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from init" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from init" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from init" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from init" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from init" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from install" -l version -d 'Specify a version to install'
complete -c cargo -n "__fish_seen_subcommand_from install" -l git -d 'Git URL to install the specified crate from'
complete -c cargo -n "__fish_seen_subcommand_from install" -l branch -d 'Branch to use when installing from git'
complete -c cargo -n "__fish_seen_subcommand_from install" -l tag -d 'Tag to use when installing from git'
complete -c cargo -n "__fish_seen_subcommand_from install" -l rev -d 'Specific commit to use when installing from git'
complete -c cargo -n "__fish_seen_subcommand_from install" -l path -d 'Filesystem path to local crate to install'
complete -c cargo -n "__fish_seen_subcommand_from install" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from install" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from install" -l profile -d 'Install artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from install" -l bin -d 'Install only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from install" -l example -d 'Install only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from install" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from install" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from install" -l root -d 'Directory to install packages into'
complete -c cargo -n "__fish_seen_subcommand_from install" -l index -d 'Registry index to install from'
complete -c cargo -n "__fish_seen_subcommand_from install" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from install" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from install" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from install" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from install" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from install" -l list -d 'list all installed packages and their versions'
complete -c cargo -n "__fish_seen_subcommand_from install" -s f -l force -d 'Force overwriting existing crates or binaries'
complete -c cargo -n "__fish_seen_subcommand_from install" -l no-track -d 'Do not save tracking information'
complete -c cargo -n "__fish_seen_subcommand_from install" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from install" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from install" -l debug -d 'Build in debug mode instead of release mode'
complete -c cargo -n "__fish_seen_subcommand_from install" -l bins -d 'Install all binaries'
complete -c cargo -n "__fish_seen_subcommand_from install" -l examples -d 'Install all examples'
complete -c cargo -n "__fish_seen_subcommand_from install" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from install" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from install" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from install" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from install" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l message-format -d 'Output representation [possible values: json, plain]'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l workspace -d 'Locate Cargo.toml of the workspace root'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from locate-project" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from login" -l host -d 'Host to set the token for'
complete -c cargo -n "__fish_seen_subcommand_from login" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from login" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from login" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from login" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from login" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from login" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from login" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from login" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from login" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from login" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from login" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from logout" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from logout" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from logout" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from logout" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from logout" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from logout" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from logout" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from logout" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from logout" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from logout" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from logout" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l filter-platform -d 'Only include resolve dependencies matching the given target-triple'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l format-version -d 'Format version' -r -f -a 1
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -s q -l quiet -d 'Do not print cargo log messages'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l no-deps -d 'Output information only about the workspace members and don\'t fetch dependencies'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from metadata" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from new" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from new" -l vcs -d 'Initialize a new repository for the given version control system (git, hg, pijul, or fossil) or do not initialize any version control at all (none), overriding a global configuration.' -r -f -a "git hg pijul fossil none"
complete -c cargo -n "__fish_seen_subcommand_from new" -l edition -d 'Edition to set for the crate generated' -r -f -a "2015 2018 2021"
complete -c cargo -n "__fish_seen_subcommand_from new" -l name -d 'Set the resulting package name, defaults to the directory name'
complete -c cargo -n "__fish_seen_subcommand_from new" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from new" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from new" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from new" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from new" -l bin -d 'Use a binary (application) template [default]'
complete -c cargo -n "__fish_seen_subcommand_from new" -l lib -d 'Use a library template'
complete -c cargo -n "__fish_seen_subcommand_from new" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from new" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from new" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from new" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from new" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from new" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s a -l add -d 'Name of a user or team to invite as an owner'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s r -l remove -d 'Name of a user or team to remove as an owner'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l index -d 'Registry index to modify owners for'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l token -d 'API token to use when authenticating'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s l -l list -d 'List owners of a crate'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from owner" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from owner" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from package" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from package" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from package" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from package" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from package" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from package" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from package" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from package" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from package" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from package" -s l -l list -d 'Print files included in a package without making one'
complete -c cargo -n "__fish_seen_subcommand_from package" -l no-verify -d 'Don\'t verify the contents by building them'
complete -c cargo -n "__fish_seen_subcommand_from package" -l no-metadata -d 'Ignore warnings about a lack of human-usable metadata'
complete -c cargo -n "__fish_seen_subcommand_from package" -l allow-dirty -d 'Allow dirty working directories to be packaged'
complete -c cargo -n "__fish_seen_subcommand_from package" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from package" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from package" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from package" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from package" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from package" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from package" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from package" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s p -l package -d 'Argument to get the package ID specifier for'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from pkgid" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l index -d 'Registry index URL to upload the package to'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l host -d 'DEPRECATED, renamed to \'--index\''
complete -c cargo -n "__fish_seen_subcommand_from publish" -l token -d 'Token to use when uploading'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from publish" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l registry -d 'Registry to publish to'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from publish" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from publish" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l no-verify -d 'Don\'t verify the contents by building them'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l allow-dirty -d 'Allow dirty working directories to be packaged'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l dry-run -d 'Perform all checks without uploading'
complete -c cargo -n "__fish_seen_subcommand_from publish" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from publish" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from publish" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from publish" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from read-manifest" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from run" -l bin -d 'Name of the bin target to run'
complete -c cargo -n "__fish_seen_subcommand_from run" -l example -d 'Name of the example target to run'
complete -c cargo -n "__fish_seen_subcommand_from run" -s p -l package -d 'Package with the target to run'
complete -c cargo -n "__fish_seen_subcommand_from run" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from run" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from run" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from run" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from run" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from run" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from run" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from run" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from run" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from run" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from run" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from run" -l release -d 'Build artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from run" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from run" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from run" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from run" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from run" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from run" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from run" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from run" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from run" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from run" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s p -l package -d 'Package to build'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l bin -d 'Build only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l example -d 'Build only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l test -d 'Build only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l bench -d 'Build only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l target -d 'Target triple which compiles will be for'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l print -d 'Output compiler information without compiling'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l lib -d 'Build only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l bins -d 'Build all binaries'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l examples -d 'Build all examples'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l tests -d 'Build all tests'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l benches -d 'Build all benches'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l all-targets -d 'Build all targets'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l release -d 'Build artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from rustc" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s p -l package -d 'Package to document'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l bin -d 'Build only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l example -d 'Build only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l test -d 'Build only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l bench -d 'Build only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l open -d 'Opens the docs in a browser after the operation'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l lib -d 'Build only this package\'s library'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l bins -d 'Build all binaries'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l examples -d 'Build all examples'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l tests -d 'Build all tests'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l benches -d 'Build all benches'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l all-targets -d 'Build all targets'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l release -d 'Build artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from rustdoc" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from search" -l index -d 'Registry index URL to upload the package to'
complete -c cargo -n "__fish_seen_subcommand_from search" -l host -d 'DEPRECATED, renamed to \'--index\''
complete -c cargo -n "__fish_seen_subcommand_from search" -l limit -d 'Limit the number of results (default: 10, max: 100)'
complete -c cargo -n "__fish_seen_subcommand_from search" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from search" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from search" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from search" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from search" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from search" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from search" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from search" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from search" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from search" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from search" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from test" -l bin -d 'Test only the specified binary'
complete -c cargo -n "__fish_seen_subcommand_from test" -l example -d 'Test only the specified example'
complete -c cargo -n "__fish_seen_subcommand_from test" -l test -d 'Test only the specified test target'
complete -c cargo -n "__fish_seen_subcommand_from test" -l bench -d 'Test only the specified bench target'
complete -c cargo -n "__fish_seen_subcommand_from test" -s p -l package -d 'Package to run tests for'
complete -c cargo -n "__fish_seen_subcommand_from test" -l exclude -d 'Exclude packages from the test'
complete -c cargo -n "__fish_seen_subcommand_from test" -s j -l jobs -d 'Number of parallel jobs, defaults to # of CPUs'
complete -c cargo -n "__fish_seen_subcommand_from test" -l profile -d 'Build artifacts with the specified profile'
complete -c cargo -n "__fish_seen_subcommand_from test" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from test" -l target -d 'Build for the target triple'
complete -c cargo -n "__fish_seen_subcommand_from test" -l target-dir -d 'Directory for all generated artifacts'
complete -c cargo -n "__fish_seen_subcommand_from test" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from test" -l message-format -d 'Error format'
complete -c cargo -n "__fish_seen_subcommand_from test" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from test" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from test" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from test" -s q -l quiet -d 'Display one character per test instead of one line'
complete -c cargo -n "__fish_seen_subcommand_from test" -l lib -d 'Test only this package\'s library unit tests'
complete -c cargo -n "__fish_seen_subcommand_from test" -l bins -d 'Test all binaries'
complete -c cargo -n "__fish_seen_subcommand_from test" -l examples -d 'Test all examples'
complete -c cargo -n "__fish_seen_subcommand_from test" -l tests -d 'Test all tests'
complete -c cargo -n "__fish_seen_subcommand_from test" -l benches -d 'Test all benches'
complete -c cargo -n "__fish_seen_subcommand_from test" -l all-targets -d 'Test all targets'
complete -c cargo -n "__fish_seen_subcommand_from test" -l doc -d 'Test only this library\'s documentation'
complete -c cargo -n "__fish_seen_subcommand_from test" -l no-run -d 'Compile, but don\'t run tests'
complete -c cargo -n "__fish_seen_subcommand_from test" -l no-fail-fast -d 'Run all tests regardless of failure'
complete -c cargo -n "__fish_seen_subcommand_from test" -l all -d 'Alias for --workspace (deprecated)'
complete -c cargo -n "__fish_seen_subcommand_from test" -l workspace -d 'Test all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from test" -l release -d 'Build artifacts in release mode, with optimizations'
complete -c cargo -n "__fish_seen_subcommand_from test" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from test" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from test" -l ignore-rust-version -d 'Ignore `rust-version` specification in packages (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from test" -l unit-graph -d 'Output build graph in JSON (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from test" -l future-incompat-report -d 'Ouputs a future incompatibility report at the end of the build (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from test" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from test" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from test" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from test" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from test" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from test" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s p -l package -d 'Package to be used as the root of the tree'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l exclude -d 'Exclude specific workspace members'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l features -d 'Space or comma separated list of features to activate'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l target -d 'Filter dependencies matching the given target-triple (default host platform). Pass `all` to include all targets.'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s e -l edges -d 'The kinds of dependencies to display (features, normal, build, dev, all, no-dev, no-build, no-normal)'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s i -l invert -d 'Invert the tree direction and focus on the given package'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l prefix -d 'Change the prefix (indentation) of how each entry is displayed' -r -f -a "depth indent none"
complete -c cargo -n "__fish_seen_subcommand_from tree" -l charset -d 'Character set to use in output: utf8, ascii' -r -f -a "utf8 ascii"
complete -c cargo -n "__fish_seen_subcommand_from tree" -s f -l format -d 'Format string used for printing dependencies'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s q -l quiet -d 'Suppress status messages'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l workspace -d 'Display the tree for all packages in the workspace'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s a -l all
complete -c cargo -n "__fish_seen_subcommand_from tree" -l all-targets
complete -c cargo -n "__fish_seen_subcommand_from tree" -l all-features -d 'Activate all available features'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-default-features -d 'Do not activate the `default` feature'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-dev-dependencies
complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-indent
complete -c cargo -n "__fish_seen_subcommand_from tree" -l prefix-depth
complete -c cargo -n "__fish_seen_subcommand_from tree" -l no-dedupe -d 'Do not de-duplicate (repeats all shared dependencies)'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s d -l duplicates -d 'Show only dependencies which come in multiple versions (implies -i)'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s V -l version
complete -c cargo -n "__fish_seen_subcommand_from tree" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from tree" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s p -l package -d 'Package to uninstall'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l bin -d 'Only uninstall the binary NAME'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l root -d 'Directory to uninstall packages from'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from update" -s p -l package -d 'Package to update'
complete -c cargo -n "__fish_seen_subcommand_from update" -l precise -d 'Update a single dependency to exactly PRECISE when used with -p'
complete -c cargo -n "__fish_seen_subcommand_from update" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from update" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from update" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from update" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from update" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from update" -s w -l workspace -d 'Only update the workspace packages'
complete -c cargo -n "__fish_seen_subcommand_from update" -l aggressive -d 'Force updating all dependencies of SPEC as well when used with -p'
complete -c cargo -n "__fish_seen_subcommand_from update" -l dry-run -d 'Don\'t actually write the lockfile'
complete -c cargo -n "__fish_seen_subcommand_from update" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from update" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from update" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from update" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from update" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from update" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -s s -l sync -d 'Additional `Cargo.toml` to sync and vendor'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l no-delete -d 'Don\'t delete older crates in the vendor directory'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l respect-source-config -d 'Respect `[source]` config in `.cargo/config`'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l versioned-dirs -d 'Always include version in subdir name'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l no-merge-sources
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l relative-path
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l only-git-deps
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l disallow-duplicates
complete -c cargo -n "__fish_seen_subcommand_from vendor" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from vendor" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l manifest-path -d 'Path to Cargo.toml'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from verify-project" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from version" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from version" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from version" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from version" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from version" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from version" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from version" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from version" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from version" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from version" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l vers -d 'The version to yank or un-yank'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l index -d 'Registry index to yank from'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l token -d 'API token to use when authenticating'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l registry -d 'Registry to use'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from yank" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from yank" -s q -l quiet -d 'No output printed to stdout'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l undo -d 'Undo a yank, putting a version back into the index'
complete -c cargo -n "__fish_seen_subcommand_from yank" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from yank" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from yank" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from yank" -l offline -d 'Run without accessing the network'
complete -c cargo -n "__fish_seen_subcommand_from help" -l color -d 'Coloring: auto, always, never'
complete -c cargo -n "__fish_seen_subcommand_from help" -l config -d 'Override a configuration value (unstable)'
complete -c cargo -n "__fish_seen_subcommand_from help" -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details'
complete -c cargo -n "__fish_seen_subcommand_from help" -s h -l help -d 'Prints help information'
complete -c cargo -n "__fish_seen_subcommand_from help" -s V -l version -d 'Prints version information'
complete -c cargo -n "__fish_seen_subcommand_from help" -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
complete -c cargo -n "__fish_seen_subcommand_from help" -l frozen -d 'Require Cargo.lock and cache are up to date'
complete -c cargo -n "__fish_seen_subcommand_from help" -l locked -d 'Require Cargo.lock is up to date'
complete -c cargo -n "__fish_seen_subcommand_from help" -l offline -d 'Run without accessing the network'

View File

@@ -6,15 +6,17 @@ complete -c complete -s s -l short-option -d "POSIX-style short option to comple
complete -c complete -s l -l long-option -d "GNU-style long option to complete" -x
complete -c complete -s o -l old-option -d "Old style long option to complete" -x
complete -c complete -s f -l no-files -d "Don't use file completion"
complete -c complete -s F -l force-files -d "Always use file completion"
complete -c complete -s r -l require-parameter -d "Require parameter"
complete -c complete -s x -l exclusive -d "Require parameter and don't use file completion"
complete -c complete -s a -l arguments -d "Space-separated list of possible option arguments" -x
complete -c complete -s a -l arguments -d "Space-separated list of possible arguments" -x
complete -c complete -s d -l description -d "Description of completion" -x
complete -c complete -s e -l erase -d "Remove completion"
complete -c complete -s h -l help -d "Display help and exit"
complete -c complete -s C -l do-complete -d "Print completions for a commandline specified as a parameter"
complete -c complete -s n -l condition -d "Completion only used if command has zero exit status" -x
complete -c complete -s w -l wraps -d "Inherit completions from specified command" -xa '(__fish_complete_command)'
complete -c complete -s k -l keep-order -d "Keep order of arguments instead of sorting alphabetically"
# Deprecated options

View File

@@ -1,4 +1,4 @@
#cryptsetup 2.3.1
#cryptsetup 2.3.5
#variables
set -l seen __fish_seen_subcommand_from
@@ -34,6 +34,7 @@ complete -c cryptsetup -l integrity-legacy-padding -d "Use inefficient legacy pa
complete -c cryptsetup -l integrity-no-journal -d "Disable journal for integrity device"
complete -c cryptsetup -l integrity-no-wipe -d "Do not wipe device after format"
complete -c cryptsetup -l iter-time -s i -d "PBKDF iteration time for LUKS (in ms)"
complete -c cryptsetup -l iv-large-sectors -d "Use IV counted in sector size (not in 512 bytes)"
complete -c cryptsetup -l json-file -d "Read or write the json from or to a file"
complete -c cryptsetup -l key-description -d "Key description"
complete -c cryptsetup -l key-file -s d -d "Read the key from a file"
@@ -54,6 +55,8 @@ complete -c cryptsetup -l pbkdf -d "PBKDF algorithm (for LUKS2): argon2i, argon2
complete -c cryptsetup -l pbkdf-force-iterations -d "PBKDF iterations cost (forced, disables benchmark)"
complete -c cryptsetup -l pbkdf-memory -d "PBKDF memory cost limit"
complete -c cryptsetup -l pbkdf-parallel -d "PBKDF parallel cost"
complete -c cryptsetup -l perf-no_read_workqueue -d "Bypass dm-crypt workqueue and process read requests synchronously"
complete -c cryptsetup -l perf-no_write_workqueue -d "Bypass dm-crypt workqueue and process write requests synchronously"
complete -c cryptsetup -l perf-same_cpu_crypt -d "Use dm-crypt same_cpu_crypt performance compatibility option"
complete -c cryptsetup -l perf-submit_from_crypt_cpus -d "Use dm-crypt submit_from_crypt_cpus performance compatibility option"
complete -c cryptsetup -l persistent -d "Set activation flags persistent for device"
@@ -80,7 +83,7 @@ complete -c cryptsetup -l token-id -d "Token number (default: any)"
complete -c cryptsetup -l token-only -d "Do not ask for passphrase if activation by token fails"
complete -c cryptsetup -l tries -s T -d "How often the input of the passphrase can be retried"
complete -c cryptsetup -l type -s M -d "Type of device metadata: luks, luks1, luks2, plain, loopaes, tcrypt, bitlk"
complete -c cryptsetup -l unbound -d "Create unbound (no assigned data segment) LUKS2 keyslot"
complete -c cryptsetup -l unbound -d "Create or dump unbound (no assigned data segment) LUKS2 keyslot"
complete -c cryptsetup -l usage -d "Display brief usage"
complete -c cryptsetup -l use-random -d "Use /dev/random for generating volume key"
complete -c cryptsetup -l use-urandom -d "Use /dev/urandom for generating volume key"

View File

@@ -10,14 +10,8 @@ function __fish_complete_dd -d 'Complete dd operands'
case 'if=*' 'of=*'
string replace = ' ' -- $operand_string | read -l operand value
for entry in $value*
# if $entry is a directory, append a '/'
if test -d $entry
echo $operand"="$entry/
else
echo $operand"="$entry
end
end
# Use normal file completions.
printf "$operand=%s\n" (complete -C "__fish_command_without_completions $value")
case 'iflag=*' 'oflag=*'
string replace = ' ' -- $operand_string | read -l operand complete

View File

@@ -19,7 +19,7 @@ complete -c dhclient -s s -x -d 'Specify the server IP address'
complete -c dhclient -s g -x -d 'Set the giaddr field'
complete -c dhclient -s i -d 'Use a DUID with DHCPv4 clients'
complete -c dhclient -s I -d 'Use the standard DDNS scheme'
complete -c dhclient -l decline-wait-time -x -d 'Time (in seconds) an IPv4 client should wait after declining an address before issuing a discover'
complete -c dhclient -l decline-wait-time -x -d 'Wait time (in secs) between declining an address and issuing discover'
complete -c dhclient -l version -d 'Print version number'
complete -c dhclient -s S -d 'Use Information-request to get only stateless configuration parameters'
complete -c dhclient -s T -d 'Ask for IPv6 temporary addresses, one set per -T flag'

View File

@@ -7,17 +7,31 @@ function __dnf_list_installed_packages
end
function __dnf_list_available_packages
set -l tok (commandline -ct | string collect)
set -l files (__fish_complete_suffix .rpm)
if string match -q -- '*/*' $tok
# Fast path - package names can't contain slashes, so show files.
string join -- \n $files
return
end
set -l results
# dnf --cacheonly list --available gives a list of non-installed packages dnf is aware of,
# but it is slow as molasses. Unfortunately, sqlite3 is not available oob (Fedora Server 32).
if type -q sqlite3
# This schema is bad, there is only a "pkg" field with the full
# packagename-version-release.fedorarelease.architecture
# tuple. We are only interested in the packagename.
sqlite3 /var/cache/dnf/packages.db "SELECT pkg FROM available WHERE pkg LIKE \"$cur%\"" 2>/dev/null |
string replace -r -- '-[^-]*-[^-]*$' ''
set results (sqlite3 /var/cache/dnf/packages.db "SELECT pkg FROM available WHERE pkg LIKE \"$tok%\"" 2>/dev/null |
string replace -r -- '-[^-]*-[^-]*$' '')
else
dnf repoquery --cacheonly "$cur*" --qf "%{NAME}" --available 2>/dev/null
set results (dnf repoquery --cacheonly "$tok*" --qf "%{NAME}" --available 2>/dev/null)
end
if set -q results[1]
set results (string match -r -- '.*\\.rpm$' $files) $results
else
set results $files
end
string join \n $results
end
function __dnf_list_transactions
@@ -103,11 +117,11 @@ end
# Info
complete -c dnf -n __fish_use_subcommand -xa info -d "Describes the given package"
complete -c dnf -n "__fish_seen_subcommand_from info; and not __fish_seen_subcommand_from history" -xa "(__dnf_list_available_packages)"
complete -c dnf -n "__fish_seen_subcommand_from info; and not __fish_seen_subcommand_from history" -k -xa "(__dnf_list_available_packages)"
# Install
complete -c dnf -n __fish_use_subcommand -xa install -d "Install package"
complete -c dnf -n "__fish_seen_subcommand_from install" -xa "(__dnf_list_available_packages)"
complete -c dnf -n "__fish_seen_subcommand_from install" -k -xa "(__dnf_list_available_packages)"
# List
complete -c dnf -n __fish_use_subcommand -xa list -d "Lists all packages"

View File

@@ -0,0 +1,268 @@
function __fish_print_firewalld_zones --description "Print list of predefined firewalld zones"
firewall-cmd --get-zones | string split " "
end
function __fish_print_firewalld_policies --description "Print list of predefined firewalld policies"
firewall-cmd --get-policies | string split " "
end
function __fish_print_firewalld_services --description "Print list of predefined firewalld services"
firewall-cmd --get-services | string split " "
end
function __fish_print_firewalld_icmptypes --description "Print list of ICMP types supported by firewalld"
firewall-cmd --get-icmptypes | string split " "
end
function __fish_print_firewalld_helpers --description "Print list of predefined firewalld helpers"
firewall-cmd --get-helpers | string split " "
end
function __fish_print_firewalld_protocols --description "Print list of protocols supported by firewalld"
string replace -f -r '^([[:alnum:]]\S*).*' '$1' < /etc/protocols
end
complete -c firewall-cmd -f
# General Options
complete -c firewall-cmd -s h -l help -d "Prints a short help text and exits"
complete -c firewall-cmd -s V -l version -d "Print the version string of firewalld"
complete -c firewall-cmd -s q -l quiet -d "Do not print status messages"
# Status Options
complete -c firewall-cmd -l state -d "Check whether the firewalld daemon is active"
complete -c firewall-cmd -l reload -d "Reload firewall rules and keep state information"
complete -c firewall-cmd -l complete-reload -d "Reload firewall completely, even netfilter kernel modules"
complete -c firewall-cmd -l runtime-to-permanent -d "Save active runtime configuration and overwrite permanent configuration"
complete -c firewall-cmd -l check-config -d "Run checks on the permanent configuration"
# Log Denied Options
complete -c firewall-cmd -l get-log-denied -d "Print the log denied setting"
complete -c firewall-cmd -l set-log-denied -xa "all unicast broadcast multicast off" -d "Add logging rules right before reject and drop rules"
# Permanent Options
complete -c firewall-cmd -l permanent -d "Set options permanently"
# Zone Options
complete -c firewall-cmd -l get-default-zone -d "Print default zone for connections and interfaces"
complete -c firewall-cmd -l set-default-zone -xa "(__fish_print_firewalld_zones)" -d "Set default zone for connections and interfaces"
complete -c firewall-cmd -l get-active-zones -d "Print currently active zones altogether with interfaces and sources"
complete -c firewall-cmd -l get-zones -d "Print predefined zones"
complete -c firewall-cmd -l get-services -d "Print predefined services"
complete -c firewall-cmd -l get-icmptypes -d "Print predefined icmptypes"
complete -c firewall-cmd -l get-zone-of-interface -xa "(__fish_print_interfaces)" -d "Print the name of the zone the interface is bound to"
complete -c firewall-cmd -l get-zone-of-source -x -d "Print the name of the zone the source is bound to"
complete -c firewall-cmd -l info-zone -xa "(__fish_print_firewalld_zones)" -d "Print information about the zone"
complete -c firewall-cmd -l list-all-zones -d "List everything added for or enabled in all zones"
complete -c firewall-cmd -l new-zone -x -d "Add a new permanent and empty zone"
complete -c firewall-cmd -l new-zone-from-file -F -d "Add a new permanent zone from a prepared zone file"
complete -c firewall-cmd -l delete-zone -xa "(__fish_print_firewalld_zones)" -d "Delete an existing permanent zone"
complete -c firewall-cmd -l load-zone-defaults -xa "(__fish_print_firewalld_zones)" -d "Load zone default settings"
complete -c firewall-cmd -l path-zone -xa "(__fish_print_firewalld_zones)" -d "Print path of the zone configuration file"
# Policy Options
complete -c firewall-cmd -l get-policies -d "Print predefined policies"
complete -c firewall-cmd -l info-policy -xa "(__fish_print_firewalld_policies)" -d "Print information about the policy"
complete -c firewall-cmd -l list-all-policies -d "List everything added for or enabled in all policies"
complete -c firewall-cmd -l new-policy -x -d "Add a new permanent policy"
complete -c firewall-cmd -l new-policy-from-file -F -d "Add a new permanent policy from a prepared policy file"
complete -c firewall-cmd -l path-policy -xa "(__fish_print_firewalld_policies)" -d "Print path of the policy configuration file"
complete -c firewall-cmd -l delete-policy -xa "(__fish_print_firewalld_policies)" -d "Delete an existing permanent policy"
complete -c firewall-cmd -l load-policy-defaults -xa "(__fish_print_firewalld_policies)" -d "Load the shipped defaults for a policy"
# Options to Adapt and Query Zones and Policies
complete -c firewall-cmd -l zone -xa "(__fish_print_firewalld_zones)" -d "Apply option to this zone"
complete -c firewall-cmd -l policy -xa "(__fish_print_firewalld_policies)" -d "Apply option to this policy"
complete -c firewall-cmd -l get-target -d "Get the target"
complete -c firewall-cmd -l set-target -xa "default CONTINUE ACCEPT DROP REJECT" -d "Set the target"
complete -c firewall-cmd -l list-all -d "List everything added for or enabled"
complete -c firewall-cmd -l list-services -d "List services added"
complete -c firewall-cmd -l add-service -xa "(__fish_print_firewalld_services)" -d "Add a service"
complete -c firewall-cmd -l remove-service -xa "(__fish_print_firewalld_services)" -d "Remove a service"
complete -c firewall-cmd -l query-service -xa "(__fish_print_firewalld_services)" -d "Return whether service has been added"
complete -c firewall-cmd -l list-ports -d "List ports added"
complete -c firewall-cmd -l list-protocols -d "List protocols added"
complete -c firewall-cmd -l list-source-ports -d "List source ports added"
complete -c firewall-cmd -l list-icmp-blocks -d "List ICMPs type blocks added"
complete -c firewall-cmd -l add-icmp-block -xa "(__fish_print_firewalld_icmptypes)" -d "Add an ICMP block for icmptype"
complete -c firewall-cmd -l remove-icmp-block -xa "(__fish_print_firewalld_icmptypes)" -d "Remove the ICMP block for icmptype"
complete -c firewall-cmd -l query-icmp-block -xa "(__fish_print_firewalld_icmptypes)" -d "Return whether an ICMP block for icmptype has been added"
complete -c firewall-cmd -l list-forward-ports -d "List IPv4 forward ports added"
complete -c firewall-cmd -l add-forward-port -x -d "Add the IPv4 forward port"
complete -c firewall-cmd -l remove-forward-port -x -d "Remove the IPv4 forward port"
complete -c firewall-cmd -l query-forward-port -x -d "Return whether the IPv4 forward port has been added"
complete -c firewall-cmd -l add-masquerade -d "Enable IPv4 masquerade"
complete -c firewall-cmd -l remove-masquerade -d "Disable IPv4 masquerade"
complete -c firewall-cmd -l query-masquerade -d "Return whether IPv4 masquerading has been enabled"
complete -c firewall-cmd -l list-rich-rules -d "List rich language rules added"
complete -c firewall-cmd -l add-rich-rule -x -d "Add rich language rule"
complete -c firewall-cmd -l remove-rich-rule -x -d "Remove rich language rule"
complete -c firewall-cmd -l query-rich-rule -x -d "Return whether the rich language rule has been added"
complete -c firewall-cmd -l timeout -x -d "The rule will be active for the specified amount of time"
# Options to Adapt and Query Zones
complete -c firewall-cmd -l add-icmp-block-inversion -d "Enable ICMP block inversion"
complete -c firewall-cmd -l remove-icmp-block-inversion -d "Disable ICMP block inversion"
complete -c firewall-cmd -l query-icmp-block-inversion -d "Return whether ICMP block inversion is enabled"
complete -c firewall-cmd -l add-forward -d "Enable intra zone forwarding"
complete -c firewall-cmd -l remove-forward -d "Disable intra zone forwarding"
complete -c firewall-cmd -l query-forward -d "Return whether intra zone forwarding is enabled"
# Options to Adapt and Query Policies
complete -c firewall-cmd -l get-priority -d "Get the priority"
complete -c firewall-cmd -l set-priority -x -d "Set the priority"
complete -c firewall-cmd -l list-ingress-zones -d "List ingress zones added"
complete -c firewall-cmd -l add-ingress-zone -xa "(__fish_print_firewalld_zones) HOST ANY" -d "Add an ingress zone"
complete -c firewall-cmd -l remove-ingress-zone -xa "(__fish_print_firewalld_zones) HOST ANY" -d "Remove an ingress zone"
complete -c firewall-cmd -l query-ingress-zone -xa "(__fish_print_firewalld_zones) HOST ANY" -d "Return whether zone has been added"
complete -c firewall-cmd -l list-egress-zones -d "List egress zones added"
complete -c firewall-cmd -l add-egress-zone -xa "(__fish_print_firewalld_zones) HOST ANY" -d "Add an egress zone"
complete -c firewall-cmd -l remove-egress-zone -xa "(__fish_print_firewalld_zones) HOST ANY" -d "Remove an egress zone"
complete -c firewall-cmd -l query-egress-zone -xa "(__fish_print_firewalld_zones) HOST ANY" -d "Return whether zone has been added"
# Options to Handle Bindings of Interfaces
complete -c firewall-cmd -l list-interfaces -d "List interfaces that are bound to zone"
complete -c firewall-cmd -l add-interface -xa "(__fish_print_interfaces)" -d "Bind interface to zone"
complete -c firewall-cmd -l change-interface -xa "(__fish_print_interfaces)" -d "Change to which zone interface is bound"
complete -c firewall-cmd -l query-interface -xa "(__fish_print_interfaces)" -d "Query whether interface is bound to zone"
complete -c firewall-cmd -l remove-interface -xa "(__fish_print_interfaces)" -d "Remove binding of interface from zone"
# Options to Handle Bindings of Sources
complete -c firewall-cmd -l list-sources -d "List sources that are bound to zone"
complete -c firewall-cmd -l add-source -x -d "Bind the source to zone"
complete -c firewall-cmd -l change-source -x -d "Change zone the source is bound to"
complete -c firewall-cmd -l query-source -x -d "Query whether the source is bound to the zone"
complete -c firewall-cmd -l remove-source -x -d "Remove binding of the source from zone"
# IPSet Options
complete -c firewall-cmd -l get-ipset-types -d "Print the supported ipset types"
complete -c firewall-cmd -l new-ipset -x -d "Add a new permanent and empty ipset"
complete -c firewall-cmd -l type -x -d "Specify ipset type"
complete -c firewall-cmd -l option -x -d "Options for new ipset"
complete -c firewall-cmd -l new-ipset-from-file -F -d "Add a new permanent ipset from a prepared ipset file"
complete -c firewall-cmd -l delete-ipset -x -d "Delete an existing permanent ipset"
complete -c firewall-cmd -l load-ipset-defaults -x -d "Load ipset default settings"
complete -c firewall-cmd -l info-ipset -x -d "Print information about the ipset"
complete -c firewall-cmd -l get-ipsets -d "Print predefined ipsets"
complete -c firewall-cmd -l ipset -x -d "Apply settings to this ipset"
complete -c firewall-cmd -l add-entry -x -d "Add a new entry to the ipset"
complete -c firewall-cmd -l remove-entry -x -d "Remove an entry from the ipset"
complete -c firewall-cmd -l query-entry -x -d "Return whether the entry has been added to an ipset"
complete -c firewall-cmd -l get-entries -d "List all entries of the ipset"
complete -c firewall-cmd -l add-entries-from-file -F -d "Add new entries to the ipset from the file"
complete -c firewall-cmd -l remove-entries-from-file -F -d "Remove existing entries from the ipset from the file"
complete -c firewall-cmd -l path-ipset -d "Print path of the ipset configuration file"
# Service Options
complete -c firewall-cmd -l info-service -xa "(__fish_print_firewalld_services)" -d "Print information about the service"
complete -c firewall-cmd -l new-service -x -d "Add a new permanent and empty service"
complete -c firewall-cmd -l new-service-from-file -F -d "Add a new permanent service from a prepared service file"
complete -c firewall-cmd -l delete-service -xa "(__fish_print_firewalld_services)" -d "Delete an existing permanent service"
complete -c firewall-cmd -l load-service-defaults -xa "(__fish_print_firewalld_services)" -d "Load service default settings"
complete -c firewall-cmd -l path-service -xa "(__fish_print_firewalld_services)" -d "Print path of the service configuration file"
complete -c firewall-cmd -l service -xa "(__fish_print_firewalld_services)" -d "Apply settings to this service"
complete -c firewall-cmd -l get-protocols -d "List protocols added to the permanent service"
complete -c firewall-cmd -l get-source-ports -d "List source ports added to the permanent service"
complete -c firewall-cmd -l add-helper -xa "(__fish_print_firewalld_helpers)" -d "Add a new helper to the permanent service"
complete -c firewall-cmd -l remove-helper -xa "(__fish_print_firewalld_helpers)" -d "Remove a helper from the permanent service"
complete -c firewall-cmd -l query-helper -xa "(__fish_print_firewalld_helpers)" -d "Return wether the helper has been added to the permanent service"
complete -c firewall-cmd -l get-service-helpers -d "List helpers added to the permanent service"
complete -c firewall-cmd -l set-destination -x -d "Set destination for ipv to address[/mask] in the permanent service"
complete -c firewall-cmd -l add-include -xa "(__fish_print_firewalld_services)" -d "Add a new include to the permanent service"
complete -c firewall-cmd -l remove-include -xa "(__fish_print_firewalld_services)" -d "Remove a include from the permanent service"
complete -c firewall-cmd -l query-include -xa "(__fish_print_firewalld_services)" -d "Return wether the include has been added to the permanent service"
complete -c firewall-cmd -l get-includes -d "List includes added to the permanent service"
# Helper Options
complete -c firewall-cmd -l info-helper -xa "(__fish_print_firewalld_helpers)" -d "Print information about the helper"
complete -c firewall-cmd -l new-helper -x -d "Add a new permanent helper"
complete -c firewall-cmd -l module -x -d "Specify module for new helper"
complete -c firewall-cmd -l new-helper-from-file -F -d "Add a new permanent helper from a prepared helper file"
complete -c firewall-cmd -l delete-helper -xa "(__fish_print_firewalld_helpers)" -d "Delete an existing permanent helper"
complete -c firewall-cmd -l load-helper-defaults -xa "(__fish_print_firewalld_helpers)" -d "Load helper default settings"
complete -c firewall-cmd -l path-helper -xa "(__fish_print_firewalld_helpers)" -d "Print path of the helper configuration file"
complete -c firewall-cmd -l get-helpers -d "Print predefined helpers as a space separated list"
complete -c firewall-cmd -l helper -xa "(__fish_print_firewalld_helpers)" -d "Apply settings to this helper"
complete -c firewall-cmd -l set-module -x -d "Set module description for helper"
complete -c firewall-cmd -l get-module -d "Print module description for helper"
complete -c firewall-cmd -l set-family -x -d "Set family description for helper"
complete -c firewall-cmd -l get-family -d "Print family description of helper"
# Internet Control Message Protocol (ICMP) type Options
complete -c firewall-cmd -l info-icmptype -xa "(__fish_print_firewalld_icmptypes)" -d "Print information about the icmptype"
complete -c firewall-cmd -l new-icmptype -x -d "Add a new permanent and empty icmptype"
complete -c firewall-cmd -l new-icmptype-from-file -F -d "Add a new permanent icmptype from a prepared icmptype file"
complete -c firewall-cmd -l delete-icmptype -xa "(__fish_print_firewalld_icmptypes)" -d "Delete an existing permanent icmptype"
complete -c firewall-cmd -l load-icmptype-defaults -xa "(__fish_print_firewalld_icmptypes)" -d "Load icmptype default settings"
complete -c firewall-cmd -l icmptype -xa "(__fish_print_firewalld_icmptypes)" -d "Apply settings to this icmptype"
complete -c firewall-cmd -l add-destination -xa "ipv4 ipv6" -d "Enable destination for ipv in permanent icmptype"
complete -c firewall-cmd -l path-icmptype -xa "(__fish_print_firewalld_icmptypes)" -d "Print path of the icmptype configuration file"
# Direct Options
complete -c firewall-cmd -l direct -d "Give a more direct access to the firewall"
complete -c firewall-cmd -l get-all-chains -d "Get all chains added to all tables"
complete -c firewall-cmd -l get-chains -xa "ipv4 ipv6 eb" -d "Get all chains added to table"
complete -c firewall-cmd -l add-chain -xa "ipv4 ipv6 eb" -d "Add a new chain to table"
complete -c firewall-cmd -l remove-chain -xa "ipv4 ipv6 eb" -d "Remove chain from table"
complete -c firewall-cmd -l query-chain -xa "ipv4 ipv6 eb" -d "Return whether the chain with given name exists in table"
complete -c firewall-cmd -l get-all-rules -d "Get all rules added to all chains in all tables"
complete -c firewall-cmd -l get-rules -xa "ipv4 ipv6 eb" -d "Get all rules added to chain in table"
complete -c firewall-cmd -l add-rule -xa "ipv4 ipv6 eb" -d "Add a rule to chain in table"
complete -c firewall-cmd -l remove-rule -xa "ipv4 ipv6 eb" -d "Remove a rule from chain in table"
complete -c firewall-cmd -l remove-rules -xa "ipv4 ipv6 eb" -d "Remove all rules in the chain in table"
complete -c firewall-cmd -l query-rule -xa "ipv4 ipv6 eb" -d "Return whether the rule exists in chain in table"
complete -c firewall-cmd -l passthrough -xa "ipv4 ipv6 eb" -d "Pass a command through to the firewall"
complete -c firewall-cmd -l get-all-passthroughs -d "Get all passthrough rules"
complete -c firewall-cmd -l get-passthroughs -xa "ipv4 ipv6 eb" -d "Get all passthrough rules for the ipv value"
complete -c firewall-cmd -l add-passthrough -xa "ipv4 ipv6 eb" -d "Add a passthrough rule"
complete -c firewall-cmd -l remove-passthrough -xa "ipv4 ipv6 eb" -d "Remove a passthrough rule"
complete -c firewall-cmd -l query-passthrough -xa "ipv4 ipv6 eb" -d "Return whether the passthrough rule exists"
# Lockdown Options
complete -c firewall-cmd -l lockdown-on -d "Enable lockdown"
complete -c firewall-cmd -l lockdown-off -d "Disable lockdown"
complete -c firewall-cmd -l query-lockdown -d "Query whether lockdown is enabled"
# Lockdown Whitelist Options
complete -c firewall-cmd -l list-lockdown-whitelist-commands -d "List all command lines that are on the whitelist"
complete -c firewall-cmd -l add-lockdown-whitelist-command -x -d "Add the command to the whitelist"
complete -c firewall-cmd -l remove-lockdown-whitelist-command -x -d "Remove the command from the whitelist"
complete -c firewall-cmd -l query-lockdown-whitelist-command -x -d "Query whether the command is on the whitelist"
complete -c firewall-cmd -l list-lockdown-whitelist-contexts -d "List all contexts that are on the whitelist"
complete -c firewall-cmd -l add-lockdown-whitelist-context -x -d "Add the context to the whitelist"
complete -c firewall-cmd -l remove-lockdown-whitelist-context -x -d "Remove the context from the whitelist"
complete -c firewall-cmd -l query-lockdown-whitelist-context -x -d "Query whether the context is on the whitelist"
complete -c firewall-cmd -l list-lockdown-whitelist-uids -d "List all user ids that are on the whitelist"
complete -c firewall-cmd -l add-lockdown-whitelist-uid -x -d "Add the user id to the whitelist"
complete -c firewall-cmd -l remove-lockdown-whitelist-uid -x -d "Remove the user id from the whitelist"
complete -c firewall-cmd -l query-lockdown-whitelist-uid -x -d "Query whether the user id is on the whitelist"
complete -c firewall-cmd -l list-lockdown-whitelist-users -d "List all user names that are on the whitelist"
complete -c firewall-cmd -l add-lockdown-whitelist-user -xa "(__fish_complete_users)" -d "Add the user to the whitelist"
complete -c firewall-cmd -l remove-lockdown-whitelist-user -xa "(__fish_complete_users)" -d "Remove the user from the whitelist"
complete -c firewall-cmd -l query-lockdown-whitelist-user -xa "(__fish_complete_users)" -d "Query whether the user is on the whitelist"
# Panic Options
complete -c firewall-cmd -l panic-on -d "Enable panic mode"
complete -c firewall-cmd -l panic-off -d "Disable panic mode"
complete -c firewall-cmd -l query-panic -d "Returns 0 if panic mode is enabled, 1 otherwise"
# Object independent options
complete -c firewall-cmd -l set-description -x -d "Set new description for zone|policy|ipset|service|helper|icmptype"
complete -c firewall-cmd -l get-description -d "Print description of zone|policy|ipset|service|helper|icmptype"
complete -c firewall-cmd -l set-short -x -d "Set short description for zone|policy|ipset|service|helper|icmptype"
complete -c firewall-cmd -l get-short -d "Print short description of zone|policy|ipset|service|helper|icmptype"
complete -c firewall-cmd -l name -x -d "Name for new zone|policy|ipset|service|helper|icmptype"
complete -c firewall-cmd -l add-port -x -d "Add the port to zone|policy|service|helper"
complete -c firewall-cmd -l remove-port -x -d "Remove the port from zone|policy|service|helper"
complete -c firewall-cmd -l query-port -x -d "Return whether the port has been added for zone|policy|service|helper"
complete -c firewall-cmd -l add-protocol -xa "(__fish_print_firewalld_protocols)" -d "Add the protocol to zone|policy|service"
complete -c firewall-cmd -l remove-protocol -xa "(__fish_print_firewalld_protocols)" -d "Remove the protocol from zone|policy|service"
complete -c firewall-cmd -l query-protocol -xa "(__fish_print_firewalld_protocols)" -d "Return whether the protocol has been added to zone|policy|service"
complete -c firewall-cmd -l add-source-port -x -d "Add the source port to zone|policy|service"
complete -c firewall-cmd -l remove-source-port -x -d "Remove the source port from zone|policy|service"
complete -c firewall-cmd -l query-source-port -x -d "Return whether the source port has been added for zone|policy|service"
complete -c firewall-cmd -l get-ports -d "List ports added to the permanent service|helper"
complete -c firewall-cmd -l remove-destination -xa "ipv4 ipv6" -d "Disable destination for ipv in permanent service|icmptype"
complete -c firewall-cmd -l query-destination -xa "ipv4 ipv6" -d "Return whether destination for ipv is enabled in permanent service|icmptype"
complete -c firewall-cmd -l get-destinations -d "List destinations in permanent service|icmptype"
complete -c firewall-cmd -l family -x -d "Inet family"

View File

@@ -0,0 +1,14 @@
complete fish_config -f
set -l prompt_commands choose save show list
complete fish_config -n '__fish_use_subcommand' -a prompt -d 'View and pick from the sample prompts'
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
-a choose -d 'View and pick from the sample prompts'
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
-a show -d 'Show what prompts would look like'
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
-a list -d 'List all available prompts'
complete fish_config -n "__fish_seen_subcommand_from prompt; and not __fish_seen_subcommand_from $prompt_commands" \
-a save -d 'Save the current or given prompt to ~/.config/fish'
complete fish_config -n '__fish_seen_subcommand_from prompt; and __fish_seen_subcommand_from choose save show' -a '(prompt list)'
complete fish_config -n '__fish_use_subcommand' -a browse -d 'Open the web-based UI'

View File

@@ -170,7 +170,9 @@ function __fish_git_files
# (don't use --ignored=no because that was only added in git 2.16, from Jan 2018.
set -q ignored; and set -a status_opt --ignored
set -q untracked; and set -a status_opt -unormal
# If we're looking for untracked files, we give untracked files even inside untracked directories.
# This makes it nicer if e.g. you're in an untracked directory and want to just add one file.
set -q untracked; and set -a status_opt -uall
or set -a status_opt -uno
# We need to set status.relativePaths to true because the porcelain v2 format still honors that,
@@ -967,6 +969,7 @@ complete -f -c git -n '__fish_git_using_command add' -a '(__fish_git_files modif
# TODO options
### checkout
complete -F -c git -n '__fish_git_using_command checkout; and contains -- -- (commandline -opc)'
complete -f -c git -n __fish_git_needs_command -a checkout -d 'Checkout and switch to a branch'
complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_tags)' -d Tag
complete -k -f -c git -n '__fish_git_using_command checkout; and not contains -- -- (commandline -opc)' -a '(__fish_git_heads)' -d Head
@@ -1060,6 +1063,8 @@ complete -x -c git -n '__fish_git_using_command commit' -l date -d 'Override the
complete -x -c git -n '__fish_git_using_command commit' -s m -l message -d 'Use the given message as the commit message'
complete -f -c git -n '__fish_git_using_command commit' -l no-edit -d 'Use the selected commit message without launching an editor'
complete -f -c git -n '__fish_git_using_command commit; and __fish_contains_opt fixup squash' -k -a '(__fish_git_recent_commits)'
complete -f -c git -n '__fish_git_using_command commit' -l allow-empty -d 'Create a commit with no changes'
complete -f -c git -n '__fish_git_using_command commit' -l allow-empty-message -d 'Create a commit with no commit message'
# TODO options
### count-objects
@@ -1071,7 +1076,6 @@ complete -f -c git -n '__fish_git_using_command count-objects' -s H -l human-rea
complete -c git -n __fish_git_needs_command -a describe -d 'Give an object a human readable name based on an available ref'
complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_tags)' -d Tag
complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_branches)'
complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch'
complete -k -f -c git -n '__fish_git_using_command describe' -a '(__fish_git_heads)' -d Head
complete -f -c git -n '__fish_git_using_command describe' -l dirty -d 'Describe the state of the working tree, append dirty if there are local changes'
complete -f -c git -n '__fish_git_using_command describe' -l broken -d 'Describe the state of the working tree, append -broken instead of erroring'
@@ -1543,7 +1547,9 @@ complete -f -c git -n "__fish_git_using_command reflog; and not __fish_seen_subc
### reset
complete -c git -n __fish_git_needs_command -a reset -d 'Reset current HEAD to the specified state'
complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset files in working directory'
complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset the index and the working tree'
complete -f -c git -n '__fish_git_using_command reset' -l soft -d 'Reset head without touching the index or the working tree'
complete -f -c git -n '__fish_git_using_command reset' -l mixed -d 'The default: reset the index but not the working tree'
complete -c git -n '__fish_git_using_command reset; and not contains -- -- (commandline -opc)' -a '(__fish_git_branches)'
# reset can either undo changes to versioned modified files,
# or remove files from the staging area.
@@ -1569,7 +1575,7 @@ complete -f -c git -n '__fish_git_using_command restore' -l overlay -d 'Never re
complete -f -c git -n '__fish_git_using_command restore' -l no-overlay -d 'Remove files when restoring (default)'
complete -f -c git -n '__fish_git_using_command restore; and not contains -- --staged (commandline -opc)' -a '(__fish_git_files modified deleted unmerged)'
complete -f -c git -n '__fish_git_using_command restore; and contains -- --staged (commandline -opc)' -a '(__fish_git_files added modified-staged deleted-staged renamed copied)'
complete -f -c git -n '__fish_git_using_command restore; and __fish_contains_opt -s s source' -a '(git ls-files)'
complete -F -c git -n '__fish_git_using_command restore; and __fish_contains_opt -s s source'
# switch options
complete -f -c git -n __fish_git_needs_command -a switch -d 'Switch to a branch'
complete -k -f -c git -n '__fish_git_using_command switch' -a '(__fish_git_local_branches)'
@@ -1599,10 +1605,14 @@ complete -f -c git -n __fish_git_needs_command -a rev-parse -d 'Pick out and mas
complete -f -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_branches)'
complete -f -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_heads)' -d Head
complete -k -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_tags)' -d Tag
complete -c git -n '__fish_git_using_command rev-parse' -l abbrev-ref -d 'Output non-ambiguous short object names'
### revert
complete -f -c git -n __fish_git_needs_command -a revert -d 'Revert an existing commit'
complete -f -c git -n '__fish_git_using_command revert' -ka '(__fish_git_commits)'
complete -f -c git -n '__fish_git_using_command revert' -l continue -d 'Continue the operation in progress'
complete -f -c git -n '__fish_git_using_command revert' -l abort -d 'Cancel the operation'
complete -f -c git -n '__fish_git_using_command revert' -l skip -d 'Skip the current commit and continue with the rest of the sequence'
# TODO options
### rm

View File

@@ -1,6 +1,6 @@
function __fish_hashcat_types --description "Get hashcat hash types"
set -l modes (hashcat --example-hashes | string replace -f -r '^MODE: (\d+)' '$1')
set -l types (hashcat --example-hashes | string replace -f -r '^TYPE: (.+)' '$1')
set -l modes (hashcat --example-hashes | string replace -f -r '^(?:MODE: |Hash mode #)(\d+)' '$1')
set -l types (hashcat --example-hashes | string replace -f -r '^(?:TYPE:|\s+Name\.+:)\s+(.+)' '$1')
for i in (seq (count $modes))
echo -e "$modes[$i]\t$types[$i]"
end
@@ -29,7 +29,8 @@ complete -c hashcat -s a -l attack-mode -d "Attack-mode" -xa "
1\t'Combination'
3\t'Brute-force'
6\t'Hybrid Wordlist + Mask'
7\t'Hybrid Mask + Wordlist'"
7\t'Hybrid Mask + Wordlist'
9\t'Association'"
complete -c hashcat -s V -l version -d "Print version"
complete -c hashcat -s h -l help -d "Print help"
complete -c hashcat -l quiet -d "Suppress output"
@@ -74,8 +75,7 @@ complete -c hashcat -l debug-mode -d "Defines the debug mode" -xa "
1\t'Finding-Rule'
2\t'Original-Word'
3\t'Original-Word:Finding-Rule'
4\t'Original-Word:Finding-Rule:Processed-Word'
"
4\t'Original-Word:Finding-Rule:Processed-Word'"
complete -c hashcat -l debug-file -rF -d "Output file for debugging rules"
complete -c hashcat -l induction-dir -xa "(__fish_complete_directories)" -d "Specify the induction directory to use for loopback"
complete -c hashcat -l outfile-check-dir -xa "(__fish_complete_directories)" -d "Specify the outfile directory to monitor for plains"
@@ -96,7 +96,8 @@ complete -c hashcat -l bitmap-min -x -d "Sets minimum bits allowed for bitmaps"
complete -c hashcat -l bitmap-max -x -d "Sets maximum bits allowed for bitmaps"
complete -c hashcat -l cpu-affinity -x -d "Locks to CPU devices"
complete -c hashcat -l hook-threads -x -d "Sets number of threads for a hook (per compute unit)"
complete -c hashcat -l example-hashes -d "Show an example hash for each hash-mode"
complete -c hashcat -l hash-info -d "Show information for each hash-mode"
complete -c hashcat -l example-hashes -d "Alias of --hash-info"
complete -c hashcat -l backend-ignore-cuda -d "Do not try to open CUDA interface on startup"
complete -c hashcat -l backend-ignore-opencl -d "Do not try to open OpenCL interface on startup"
complete -c hashcat -s I -l backend-info -d "Show info about detected backend API devices"
@@ -107,8 +108,7 @@ complete -c hashcat -s w -l workload-profile -d "Enable a specific workload prof
1\tLow
2\tDefault
3\tHigh
4\tNightmare
"
4\tNightmare"
complete -c hashcat -s n -l kernel-accel -x -d "Manual workload tuning, set outerloop step size"
complete -c hashcat -s u -l kernel-loops -x -d "Manual workload tuning, set innerloop step size"
complete -c hashcat -s T -l kernel-threads -x -d "Manual workload tuning, set thread count"
@@ -141,8 +141,7 @@ complete -c hashcat -s z -l brain-client -d "Enable brain client, activates -S"
complete -c hashcat -l brain-client-features -d "Define brain client features" -xa "
1\t'Send hashed passwords'
2\t'Send attack positions'
3\t'Send hashed passwords and attack positions'
"
3\t'Send hashed passwords and attack positions'"
complete -c hashcat -l brain-host -xa "(__fish_print_hostnames)" -d "Brain server host (IP or domain)"
complete -c hashcat -l brain-port -x -d "Brain server port"
complete -c hashcat -l brain-password -x -d "Brain server authentication password"

View File

@@ -105,3 +105,69 @@ complete -c help -x -a releasenotes -d "Fish's release notes"
complete -c help -x -a completions -d "How to write completions"
complete -c help -x -a faq -d "Frequently Asked Questions"
complete -c help -x -a fish-for-bash-users -d "Differences from bash"
complete -c help -x -a argument-handling -d "How to handle arguments"
complete -c help -x -a autoloading-functions -d "How functions are loaded"
complete -c help -x -a brace-expansion -d "{a,b} brace expansion"
complete -c help -x -a builtin-commands -d "An overview of fish's builtins"
complete -c help -x -a combining-different-expansions -d "How different expansions work together"
complete -c help -x -a combining-lists-cartesian-product -d "How lists combine"
complete -c help -x -a command-substitution -d "(command) command substitution"
complete -c help -x -a comments -d "# comments"
complete -c help -x -a conditions -d "ifs and elses"
complete -c help -x -a defining-aliases -d "How to define an alias"
complete -c help -x -a escaping-characters -d "How \\\\ escaping works"
complete -c help -x -a exporting-variables -d "What set -x does"
complete -c help -x -a functions -d "How to define functions"
complete -c help -x -a home-directory-expansion -d "~ expansion"
complete -c help -x -a index-range-expansion -d "var[x..y] slices"
complete -c help -x -a input-output-redirection -d "< and > redirectoins"
complete -c help -x -a lists -d "Variables with multiple elements"
complete -c help -x -a loops-and-blocks -d "while, for and begin"
complete -c help -x -a more-on-universal-variables
complete -c help -x -a overriding-variables-for-a-single-command -d "foo=bar variable overrides"
complete -c help -x -a pager-color-variables -d "How to color the pager"
complete -c help -x -a path-variables -d 'Why $PATH is special'
complete -c help -x -a shell-variable-and-function-names -d 'What characters are allowed in names'
complete -c help -x -a shell-variables
complete -c help -x -a special-variables
complete -c help -x -a syntax-highlighting-variables
complete -c help -x -a syntax-overview
complete -c help -x -a terminology
complete -c help -x -a the-fish-language
complete -c help -x -a the-status-variable -d '$status, the return code'
complete -c help -x -a variable-expansion -d '$variable'
complete -c help -x -a variable-scope -d 'Local, global and universal scope'
complete -c help -x -a variable-scope-for-functions
complete -c help -x -a wildcards-globbing
complete -c help -x -a abbreviations
complete -c help -x -a command-line-editor
complete -c help -x -a configurable-greeting
complete -c help -x -a copy-and-paste-kill-ring
complete -c help -x -a custom-bindings
complete -c help -x -a directory-stack
complete -c help -x -a emacs-mode-commands
complete -c help -x -a help
complete -c help -x -a interactive-use
complete -c help -x -a multiline-editing
complete -c help -x -a navigating-directories
complete -c help -x -a private-mode
complete -c help -x -a programmable-prompt
complete -c help -x -a programmable-title
complete -c help -x -a searchable-command-history
complete -c help -x -a shared-bindings
complete -c help -x -a syntax-highlighting
complete -c help -x -a vi-mode-commands
complete -c help -x -a arithmetic-expansion
complete -c help -x -a blocks-and-loops
complete -c help -x -a builtins-and-other-commands
complete -c help -x -a command-substitutions
complete -c help -x -a heredocs
complete -c help -x -a process-substitution
complete -c help -x -a prompts -d 'How to make your own prompt'
complete -c help -x -a quoting -d 'How "" and \'\' work'
complete -c help -x -a special-variables
complete -c help -x -a string-manipulation
complete -c help -x -a test-test
complete -c help -x -a wildcards-globs
complete -c help -x -a frequently-asked-questions

View File

@@ -1,4 +1,4 @@
#Keybase 5.3.0
#Keybase 5.6.1
function __fish_keybase_line_ends_with
set -l line (commandline -poc | string match -v -r '^-')
@@ -13,12 +13,13 @@ end
set -l ends __fish_keybase_line_ends_with
set -l seen __fish_seen_subcommand_from
#L1
set -l keybase account blocks bot chat ctl currency decrypt deprovision device encrypt follow fs git h help id kvstore list-followers list-following log login logout oneshot paperkey passphrase pgp ping prove rekey selfprovision service sign signup sigs status team track unfollow untrack update verify version wallet whoami
set -l keybase account blocks bot chat config ctl currency decrypt deprovision device encrypt follow fs git h help id kvstore list-followers list-following log login logout oneshot paperkey passphrase pgp ping prove rekey selfprovision service sign signup sigs status team track unfollow untrack update verify version wallet whoami
#L2
set -l keybase_account contact-settings delete email h help lockdown recover-username upload-avatar
set -l keybase_blocks h help list-users list-teams
set -l keybase_bot h help signup token
set -l keybase_chat add-bot-member add-to-channel api api-listen bot-member-settings clear-commands conv-info create-channel default-channels delete-channel delete-history download edit-bot-member featured-bots h help hide join-channel leave-channel list list-channels list-members list-unread ls lsur min-writer-role mute notification-settings read readd-member remove-bot-member rename-channel report retention-policy search search-bots search-regexp send upload
set -l keybase_config get h help info set
set -l keybase_ctl app-exit autostart h help init log-rotate redirector reload restart start stop wait watchdog watchdog2
set -l keybase_currency add h help
set -l keybase_device add h help list remove
@@ -122,6 +123,7 @@ complete -c keybase -f -n "$ends keybase account" -a "$keybase_account"
complete -c keybase -f -n "$ends keybase blocks" -a "$keybase_blocks"
complete -c keybase -f -n "$ends keybase bot" -a "$keybase_bot"
complete -c keybase -f -n "$ends keybase chat" -a "$keybase_chat"
complete -c keybase -f -n "$ends keybase config" -a "$keybase_config"
complete -c keybase -f -n "$ends keybase ctl" -a "$keybase_ctl"
complete -c keybase -f -n "$ends keybase currency" -a "$keybase_currency"
complete -c keybase -f -n "$ends keybase device" -a "$keybase_device"

View File

@@ -1 +0,0 @@
complete -c la -w ls

View File

@@ -1 +0,0 @@
complete -c ll -w ls

View File

@@ -1,4 +1,4 @@
#loginctl (systemd 245)
#loginctl (systemd 248)
#variables
set -l seen __fish_seen_subcommand_from
@@ -21,6 +21,7 @@ complete -c loginctl -f -n "not $seen $commands" -l no-legend -d "Do not show th
complete -c loginctl -f -n "not $seen $commands" -l no-pager -d "Do not pipe output into a pager"
complete -c loginctl -x -n "not $seen $commands" -l output -s o -a "$output" -d "Change journal output mode"
complete -c loginctl -x -n "not $seen $commands" -l property -s p -d "Show only properties by this name"
complete -c loginctl -x -n "not $seen $commands" -s P -d "Equivalent to --value --property"
complete -c loginctl -x -n "not $seen $commands" -l signal -s s -d "Which signal to send"
complete -c loginctl -f -n "not $seen $commands" -l value -d "When showing properties, only print the value"
complete -c loginctl -f -n "not $seen $commands" -l version -d "Show package version"

View File

@@ -1,2 +1,3 @@
complete -f -c math -r
complete -f -c math -s s -l scale -r -x
complete -f -c math -s s -l scale -r
complete -f -c math -s b -l base -r

View File

@@ -34,7 +34,20 @@ complete -c mvn -r -f -o b -l builder -d "The id of the build strategy to use."
complete -c mvn -f -o C -l strict-checksums -d "Fail the build if checksums don't match"
complete -c mvn -f -o c -l lax-checksums -d "Warn if checksums don't match"
complete -c mvn -f -o cpu -l check-plugin-updates -d "Ineffective, only kept for backward compatibility"
function __fish_mvn_complete_definition
set -l current_token (commandline -t)
set -l previous_token (commandline -opc)[-1]
string match -qr -- '^(-D|--define\b)' $current_token $previous_token
or return
set -l keyval (string split --max=1 -- = $current_token)
or return
# Use normal file completion for the value.
printf -- "$keyval[1]=%s\n" (complete -C "__fish_command_without_completions $keyval[2]")
end
complete -c mvn -f -o D -l define -d "Define a system property"
complete -c mvn -f -a "(__fish_mvn_complete_definition)"
complete -c mvn -f -o e -l errors -d "Produce execution error messages"
complete -c mvn -f -o emp -l encrypt-master-password -d "Encrypt master security password"
complete -c mvn -f -o ep -l encrypt-password -d "Encrypt server password"

View File

@@ -1,11 +1,15 @@
function __fish_openssl_subcommand_options --description "Print options for openssl subcommand"
set -l cmd (commandline -poc)
openssl list -options $cmd[2] | string replace -r -- '^(\S*)\s*.*' '-$1'
end
if command openssl list -1 2>&1 >/dev/null
if string match -q "OpenSSL*" (command openssl version)
# This is real OpenSSL that has the list command.
function __fish_openssl_subcommand_options --description "Print options for openssl subcommand"
set -l cmd (commandline -poc)
openssl list -options $cmd[2] | string replace -r -- '^(\S*)\s*.*' '-$1'
end
complete -c openssl -n __fish_use_subcommand -x -a "(openssl list -1 -commands -cipher-commands -digest-commands)"
complete -c openssl -n 'not __fish_use_subcommand && string match -qr -- "^-" (commandline -ct)' -a "(__fish_openssl_subcommand_options)"
else
complete -c openssl -n __fish_use_subcommand -x -a "(openssl help 2>&1 | string match -rv '^[A-Z]|^\$' | string split -n ' ')"
# Perhaps LibreSSL - see #7966
# TODO: support subcommand options.
complete -c openssl -n __fish_use_subcommand -x -a "(openssl help 2>&1 | string match -rv '^[A-Z]|^\$|Error' | string split -n ' ')"
end
complete -c openssl -n 'not __fish_use_subcommand && string match -qr -- "^-" (commandline -ct)' -a "(__fish_openssl_subcommand_options)"

View File

@@ -1,13 +1,13 @@
# Pulseaudio's pacmd
# This covers the most useful commands
set -l commands (pacmd help | string match -r '^ +[-\w]+' | string trim)
set -l commands (pacmd help 2>/dev/null | string match -r '^ +[-\w]+' | string trim)
complete -f -c pacmd
complete -f -c pacmd -w pactl
# These descriptions are a bit wordy and unnecessary
# Sample: set-source-port Change the port of a source (args: index|name, port-name)
# Or: list-source-outputs List source outputs
complete -f -c pacmd -n "not __fish_seen_subcommand_from $commands" -a "(pacmd help | string match ' *' | string trim | string replace -r '\s+' '\t')"
complete -f -c pacmd -n "not __fish_seen_subcommand_from $commands" -a "(pacmd help 2>/dev/null | string match ' *' | string trim | string replace -r '\s+' '\t')"
# Since we wrapped pactl, we can also use functions defined there
complete -f -c pacmd -n "__fish_seen_subcommand_from describe-module" -a '(__fish_pa_complete_type modules)'

View File

@@ -12,7 +12,7 @@ set -l ctlcommands stat info list exit {upload,play,remove}-sample {load,unload}
# HACK: This is the list of commands from pacmd - used so we can use complete -w there
if command -sq pacmd
set commands (pacmd help | string match -r '^ +[-\w]+' | string trim)
set commands (pacmd help 2>/dev/null | string match -r '^ +[-\w]+' | string trim)
else
set commands $ctlcommands
end

View File

@@ -12,6 +12,6 @@ complete -c pydf -s m -l megabytes -d 'like --block-size=1048576'
complete -c pydf -s g -l gigabytes -d 'like --block-size=1073741824'
complete -c pydf -l blocks -d 'use filesystem native block size'
complete -c pydf -l bw -d 'do not use colours'
complete -c pydf -l mounts -r -d 'file to get mount information from. On normal Linux systems only /etc/mtab or /proc/mounts make sense. Some other Unices use /etc/mnttab. Use /proc/mounts when /etc/mtab is corrupted or inaccessible (the output looks a bit weird in this case).'
complete -c pydf -l mounts -r -d 'file to get mount information from'
complete -c pydf -s B -l show-binds -d 'show \'mount --bind\' mounts'
complete -c pydf -s i -l inodes -d 'show inode instead of block usage'

View File

@@ -16,7 +16,7 @@ function __fish_complete_rc-update_runlevels
default \
'Last startup runlevel' \
shutdown \
'Runlevel for stutting down'
'Runlevel for shutting down'
printf "%s\t%s\n" $levels
end

View File

@@ -15,6 +15,6 @@ complete -c read -s n -l nchars -d "Read the specified number of characters" -x
complete -c read -s a -l list -l array -d "Store the results as an array"
complete -c read -s R -l right-prompt -d "Set right-hand prompt command" -x
complete -c read -s z -l null -d "Use NUL character as line terminator"
complete -c read -s l -l line -d "Read each line into its own variable"
complete -c read -s L -l line -d "Read each line into its own variable"
complete -c read -s d -l delimiter -d "Set string to use as delimiter" -x
complete -c read -s t -l tokenize -d "Use shell tokenization rules when splitting"

View File

@@ -1,8 +1,8 @@
#resolvectl (systemd 245)
#resolvectl (systemd 248)
#variables
set -l seen __fish_seen_subcommand_from
set -l commands default-route dns dnsovertls dnssec domain flush-caches llmnr mdns nta openpgp query reset-server-features reset-statistics revert service statistics status tlsa
set -l commands default-route dns dnsovertls dnssec domain flush-caches llmnr log-level mdns nta openpgp query reset-server-features reset-statistics revert service statistics status tlsa
#commands
complete -c resolvectl -x -n "not $seen $commands" -a "$commands"
@@ -10,16 +10,22 @@ complete -c resolvectl -x -n "not $seen $commands" -a "$commands"
#options
complete -c resolvectl -f -n "not $seen $commands" -s 4 -d "Resolve IPv4 addresses"
complete -c resolvectl -f -n "not $seen $commands" -s 6 -d "Resolve IPv6 addresses"
complete -c resolvectl -x -n "not $seen $commands" -l cache -d "Allow response from cache"
complete -c resolvectl -x -n "not $seen $commands" -l class -s c -d "Query RR with DNS class"
complete -c resolvectl -x -n "not $seen $commands" -l cname -d "Follow CNAME redirects"
complete -c resolvectl -f -n "not $seen $commands" -l help -s h -d "Show this help"
complete -c resolvectl -x -n "not $seen $commands" -l interface -s i -d "Look on interface"
complete -c resolvectl -x -n "not $seen $commands" -l legend -d "Print headers and additional info"
complete -c resolvectl -x -n "not $seen $commands" -l network -d "Allow response from network"
complete -c resolvectl -f -n "not $seen $commands" -l no-pager -d "Do not pipe output into a pager"
complete -c resolvectl -x -n "not $seen $commands" -l protocol -s p -d "Look via protocol"
complete -c resolvectl -f -n "not $seen $commands" -l raw -d "Dump the answer as binary data"
complete -c resolvectl -x -n "not $seen $commands" -l search -d "Use search domains for single-label names"
complete -c resolvectl -x -n "not $seen $commands" -l service-address -d "Resolve address for services"
complete -c resolvectl -x -n "not $seen $commands" -l service-txt -d "Resolve TXT records for services"
complete -c resolvectl -x -n "not $seen $commands" -l synthesize -d "Allow synthetic response"
complete -c resolvectl -x -n "not $seen $commands" -l trust-anchor -d "Allow response from local trust anchor"
complete -c resolvectl -x -n "not $seen $commands" -l type -s t -d "Query RR with DNS type"
complete -c resolvectl -x -n "not $seen $commands" -l validate -d "Allow DNSSEC validation"
complete -c resolvectl -f -n "not $seen $commands" -l version -d "Show package version"
complete -c resolvectl -x -n "not $seen $commands" -l zone -d "Allow response from locally registered mDNS/LLMNR records"

View File

@@ -20,20 +20,20 @@ complete -c rpm -l root -d "Specify root directory for rpm operations" -a "
set -l rpm_install -c rpm -n "__fish_contains_opt -s i -s U -s F install upgrade freshen"
complete $rpm_install -l aid -d "Add suggested packages to the transaction set when needed"
complete $rpm_install -l allfiles -d "Installs or upgrades all the files in the package, even if they aren't needed (missingok) and don't exist"
complete $rpm_install -l badreloc -d "Used with --relocate, permit relocations on all file paths, not just those OLD-PATH's included in the binary package relocation hint(s)"
complete $rpm_install -l allfiles -d "Install all files in package, even those not needed (missingok)"
complete $rpm_install -l badreloc -d "Allow path relocations not included in package hints (requires --relocate)"
complete $rpm_install -l excludepath -d "Don't install files whose name begins with specified path" -xa "(__fish_complete_directories (commandline -ct) 'Skip installation of files in this directory')"
complete $rpm_install -l excludedocs -d "Don't install any files which are marked as documentation"
complete $rpm_install -l force -d 'Same as using --replacepkgs, --replacefiles, and --oldpackage'
complete $rpm_install -s h -l hash -d 'Print 50 hash marks as the package archive is unpacked'
complete $rpm_install -l ignoresize -d "Don't check for sufficient disk space before installation"
complete $rpm_install -l ignorearch -d "Allow installation or upgrading even if the architectures of the binary package and host don't match"
complete $rpm_install -l ignoreos -d "Allow installation or upgrading even if the operating systems of the binary package and host don't match"
complete $rpm_install -l ignorearch -d "Ignore host and package architecture mismatch"
complete $rpm_install -l ignoreos -d "Ignore host and package OS mismatch"
complete $rpm_install -l includedocs -d 'Install documentation files (default)'
complete $rpm_install -l justdb -d 'Update only the database, not the filesystem'
complete $rpm_install -l nodigest -d "Don't verify package or header digests when reading"
complete $rpm_install -l nosignature -d "Don't verify package or header signatures when reading"
complete $rpm_install -l nodeps -d "Don't do a dependency check"
complete $rpm_install -l nodeps -d "Don't perform a dependency check"
complete $rpm_install -l nosuggest -d "Don't suggest package(s) that provide a missing dependency"
complete $rpm_install -l noorder -d "Don't change the package installation order"
complete $rpm_install -l noscripts -d "Don't execute scripts"
@@ -46,27 +46,27 @@ complete $rpm_install -l notriggerin -d "Don't execute triggerin scriptlets"
complete $rpm_install -l notriggerun -d "Don't execute triggerun scriptlets"
complete $rpm_install -l notriggerpostun -d "Don't execute triggerpostun scriptlets"
complete $rpm_install -l oldpackage -d 'Allow an upgrade to replace a newer package with an older one'
complete $rpm_install -l percent -d 'Print percentages as files are unpacked from the package archive. This is intended to make rpm easy to run from other tools'
complete $rpm_install -l prefix -d 'For relocatable binary packages, translate all file paths that start with the installation prefix in the package relocation hint(s) to NEWPATH' -xa "(__fish_complete_directories (commandline -ct) 'Directory prefix for relocatable packages')"
complete $rpm_install -l relocate -x -d "Translate all paths that start with first half of following parameter to second half of following parameter"
complete $rpm_install -l percent -d 'Output percentages as files are unpacked from the package archive'
complete $rpm_install -l prefix -d 'Replace path prefix for relocatable binary packages with NEWPATH' -xa "(__fish_complete_directories (commandline -ct) 'Directory prefix for relocatable packages')"
complete $rpm_install -l relocate -x -d "Replace OLDPATH prefixes for relocatable packages with NEWPATH"
complete $rpm_install -l repackage -d 'Re-package the files before erasing'
complete $rpm_install -l replacefiles -d 'Install the packages even if they replace files from other, already installed, packages'
complete $rpm_install -l replacepkgs -d 'Install the packages even if some of them are already installed on this system'
complete $rpm_install -l test -d "Don't install the package, simply check for and report potential conflicts"
complete $rpm_install -l replacefiles -d 'Install packages even if they replace files from other installed packages'
complete $rpm_install -l replacepkgs -d 'Install packages even if they are already installed'
complete $rpm_install -l test -d "Don't install, only check and report potential conflicts"
set -l rpm_query -c rpm -n "__fish_contains_opt -s q query"
complete $rpm_query -l changelog -d 'Display change information for the package'
complete $rpm_query -s c -l configfiles -d 'List only configuration files (implies -l)'
complete $rpm_query -s d -l docfiles -d 'List only documentation files (implies -l)'
complete $rpm_query -l dump -d 'Dump file information. Must be used with at least one of -l, -c, -d'
complete $rpm_query -l dump -d 'Dump file information. Requires at least one of -l, -c, -d'
complete $rpm_query -l filesbypkg -d 'List all the files in each selected package'
complete $rpm_query -s i -l info -d 'Display package information, including name, version, and description. Uses --queryformat if specified'
complete $rpm_query -s i -l info -d 'Display package details, uses --queryformat if specified'
complete $rpm_query -l last -d 'Orders the package listing by install time'
complete $rpm_query -s l -l list -d 'List files in package'
complete $rpm_query -l provides -d 'List capabilities this package provides'
complete $rpm_query -s R -l requires -d 'List packages on which this package depends'
complete $rpm_query -l scripts -d 'List the package specific scriptlets'
complete $rpm_query -s s -l state -d 'Display the states of files in the package. The state of each file is one of normal, not installed, or replaced'
complete $rpm_query -s s -l state -d 'Display the states of files in the package'
complete $rpm_query -l triggers -d 'Display the trigger scripts contained in the package'
complete $rpm_query -l triggerscripts -d 'Display the trigger scripts contained in the package'
@@ -74,16 +74,16 @@ set -l rpm_select -c rpm -n "__fish_contains_opt -s q -s V query verify"
complete $rpm_select -a "(__fish_print_rpm_packages)"
complete $rpm_select -s a -l all -d 'Query all installed packages'
complete $rpm_select -s f -l file -d 'Query package owning specified file' -rF
complete $rpm_select -l fileid -d 'Query package that contains a given file identifier, i.e. the MD5 digest of the file contents' -x
complete $rpm_select -l fileid -d 'Query package that contains a given file identifier' -x
complete $rpm_select -s g -l group -d 'Query packages with the specified group' -x
complete $rpm_select -l hdrid -d 'Query package that contains a given header identifier, i.e. the SHA1 digest of the immutable header region' -x
complete $rpm_select -l hdrid -d 'Query package that contains a given header identifier' -x
complete $rpm_select -s p -l package -d 'Query an (uninstalled) package in specified file' -k -xa "(__fish_complete_suffix .rpm)"
complete $rpm_select -l pkgid -d 'Query package that contains a given package identifier, i.e. the MD5 digest of the combined header and payload contents' -x
complete $rpm_select -l pkgid -d 'Query package that contains a given package identifier' -x
complete $rpm_select -l specfile -d 'Parse and query specified spec-file as if it were a package' -k -xa "(__fish_complete_suffix .spec)"
complete $rpm_select -l tid -d 'Query package(s) that have the specified TID (transaction identifier)' -x
complete $rpm_select -l triggeredby -d 'Query packages that are triggered by the specified packages' -x -a "(__fish_print_rpm_packages)"
complete $rpm_select -l whatprovides -d 'Query all packages that provide the specified capability' -x
complete $rpm_select -l whatrequires -d 'Query all packages that requires the specified capability for functioning' -x
complete $rpm_select -l whatrequires -d 'Query all packages that require the specified capability' -x
set -l rpm_verify -c rpm -n "__fish_contains_opt -s V verify"
complete $rpm_verify -l nodeps -d "Don't verify dependencies of packages"

View File

@@ -1,8 +1,7 @@
#
# Load completions shared by ssh and scp.
#
# Load completions shared by various ssh tools like ssh, scp and sftp.
__fish_complete_ssh scp
# Helper functions to simplify the completions.
function __scp2ssh_port_number
# There is a silly inconsistency between the ssh and scp commands regarding the short flag name
@@ -58,10 +57,11 @@ complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -
string escape -n
)
"
complete -c scp -s 3 -d "Copies between two remote hosts are transferred through the local host"
complete -c scp -s B -d "Batch mode"
complete -c scp -s l -x -d "Bandwidth limit"
complete -c scp -s P -x -d Port
complete -c scp -s p -d "Preserves modification times, access times, and modes from the original file"
complete -c scp -s q -d "Do not display progress bar"
complete -c scp -s r -d "Recursively copy"
complete -c scp -s S -d "Encryption program"
complete -c scp -s T -d "Disable strict filename checking"

View File

@@ -1,24 +1,18 @@
# Load completions shared by various ssh tools like ssh, scp and sftp.
__fish_complete_ssh sftp
complete -c sftp -x -a "(__fish_complete_user_at_hosts)"
complete -c sftp -s 4 -d 'Use IPv4 addresses only'
complete -c sftp -s 6 -d 'Use IPv6 addresses only'
complete -c sftp -s a -d 'Attempt to continue interrupted transfers'
complete -c sftp -s B -x -d 'Size of the buffer when transferring files'
complete -c sftp -s b -F -d 'Reads a series of commands from an input batchfile'
complete -c sftp -s C -d 'Enables compression'
complete -c sftp -s c -x -d 'The cipher to use for encrypting data'
complete -c sftp -s D -x -d 'Connect directly to a local sftp server'
complete -c sftp -s F -F -d 'Alternative per-user configuration file'
complete -c sftp -s D -x -d 'Connect directly to a local SFTP server'
complete -c sftp -s f -d 'Flush files to disk after transfer'
complete -c sftp -s i -F -d 'Identity (private key) file'
complete -c sftp -s J -x -a "(__fish_complete_user_at_hosts)" -d 'ProxyJump host'
complete -c sftp -s l -x -d 'Limits the used bandwidth (Kbit/s)'
complete -c sftp -s o -x -d 'Set additional ssh_config options'
complete -c sftp -s N -d 'Disables quiet mode'
complete -c sftp -s P -x -d 'Port to connect to on the remote host'
complete -c sftp -s p -d 'Preserve timestamps from the original files transferred'
complete -c sftp -s q -d 'Quiet mode'
complete -c sftp -s R -x -d 'How many requests may be outstanding'
complete -c sftp -s r -d 'Recursively copy entire directories'
complete -c sftp -s S -r -d 'Program to use for the encrypted connection'
complete -c sftp -s s -x -d 'The SSH2 subsystem or the path for an sftp server'
complete -c sftp -s v -d 'Raise logging level'

View File

@@ -1,53 +1,49 @@
#
# Load completions shared by ssh and scp.
#
# Load completions shared by various ssh tools like ssh, scp and sftp.
__fish_complete_ssh ssh
#
# ssh specific completions
#
complete -x -c ssh -d Remote -a "(__fish_complete_user_at_hosts)"
# Disable as username completion is not very useful.
# complete -x -c ssh -d User -a "
# (__fish_print_users | string match -r -v '^_')@
# "
complete -c ssh -n 'test (__fish_number_of_cmd_args_wo_opts) -ge 2' -d "Command to run" -x -a '(__fish_complete_subcommand --fcs-skip=2)'
complete -c ssh -s a -d "Disables forwarding of the authentication agent"
complete -c ssh -s A -d "Enables forwarding of the authentication agent"
complete -x -c ssh -s b -d "Local address to bind to" -a '(__fish_print_addresses)'
complete -x -c ssh -s e -d "Escape character" -a "\^ none"
complete -c ssh -s f -d "Go to background"
complete -c ssh -s g -d "Allow remote host to connect to local forwarded ports"
complete -c ssh -s I -d "Smartcard device"
complete -c ssh -s k -d "Disable forwarding of Kerberos tickets"
complete -c ssh -s l -x -a "(__fish_complete_users)" -d User
complete -c ssh -s m -d "MAC algorithm"
complete -c ssh -s n -d "Prevent reading from stdin"
complete -c ssh -s N -d "Do not execute remote command"
complete -c ssh -s p -x -d Port
complete -c ssh -s q -d "Quiet mode"
complete -c ssh -s s -d Subsystem
complete -c ssh -s t -d "Force pseudo-tty allocation"
complete -c ssh -s T -d "Disable pseudo-tty allocation"
complete -c ssh -s x -d "Disable X11 forwarding"
complete -c ssh -s X -d "Enable X11 forwarding"
complete -c ssh -s L -d "Locally forwarded ports"
complete -c ssh -s R -d "Remotely forwarded ports"
complete -c ssh -s D -d "Dynamic port forwarding"
complete -c ssh -s c -d "Encryption cipher" -xa "(ssh -Q cipher)"
# Also retrieve `user@host` entries from history
function __ssh_history_completions --argument-names limit
if string match -q ""
set limit 100
end
history --prefix ssh --max=$limit | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1'
function __ssh_history_completions
history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1'
end
complete -k -c ssh -a '(__ssh_history_completions 100)' -f -d Remote
complete -c ssh -d Remote -xa "(__fish_complete_user_at_hosts)"
complete -c ssh -d Remote -k -fa '(__ssh_history_completions)'
complete -c ssh -n 'test (__fish_number_of_cmd_args_wo_opts) -ge 2' -d "Command to run" -xa '(__fish_complete_subcommand --fcs-skip=2)'
complete -c ssh -s a -d "Disables forwarding of the authentication agent"
complete -c ssh -s B -d "Bind to the address of that interface" -xa '(__fish_print_interfaces)'
complete -c ssh -s b -d "Local address to bind to" -xa '(__fish_print_addresses)'
complete -c ssh -s E -d "Append debug logs to log_file" -rF
complete -c ssh -s e -d "Escape character" -xa "\^ none"
complete -c ssh -s f -d "Go to background"
complete -c ssh -s G -d "Print configuration after evaluating Host"
complete -c ssh -s g -d "Allow remote host to connect to local forwarded ports"
complete -c ssh -s I -d "Specify the PKCS#11 library" -r
complete -c ssh -s K -d "Enables GSSAPI-based authentication"
complete -c ssh -s k -d "Disables forwarding of GSSAPI credentials"
complete -c ssh -s L -d "Specify local port forwarding" -x
complete -c ssh -s l -x -a "(__fish_complete_users)" -d User
complete -c ssh -s M -d "Places the ssh client into master mode"
complete -c ssh -s m -d "MAC algorithm" -xa "(__fish_complete_list , __fish_ssh_macs)"
complete -c ssh -s N -d "Do not execute remote command"
complete -c ssh -s n -d "Prevent reading from stdin"
complete -c ssh -s O -d "Control an active connection multiplexing master process" -x
complete -c ssh -s p -d Port -x
complete -c ssh -s Q -d "List supported algorithms" -xa "(ssh -Q help)"
complete -c ssh -s R -d "Specify remote/reverse port forwarding" -x
complete -c ssh -s S -d "Location of a control socket for connection sharing" -r
complete -c ssh -s s -d Subsystem
complete -c ssh -s T -d "Disable pseudo-tty allocation"
complete -c ssh -s t -d "Force pseudo-tty allocation"
complete -c ssh -s V -d "Display version number"
complete -c ssh -s W -d "Forward stdin/stdout to host:port over secure channel" -x
complete -c ssh -s w -d "Requests tunnel device forwarding" -x
complete -c ssh -s X -d "Enable X11 forwarding"
complete -c ssh -s x -d "Disable X11 forwarding"
complete -c ssh -s Y -d "Enables trusted X11 forwarding"
complete -c ssh -s y -d "Send log information using syslog"

76
share/completions/sv.fish Normal file
View File

@@ -0,0 +1,76 @@
# Completions for sv
# A part of the runit init system
# Author: Leonardo da Rosa Eugênio <lelgenio@disroot.org>
set -l commands \
status up down once s u d o pause cont hup \
alarm interrupt quit 1 2 term kill exit p c h \
a i q 1 2 t k e start stop reload restart \
shutdown force-stop force-reload force-restart force-shutdown \
try-restart check
function __fish_complete_sv_list_services
for dir in $SVDIR /run/runit/service/ /etc/runit/current /etc/runit/runsvdir/
test -d $dir
and break
end
set -l services (string match -r '[^/]*$' $dir/*)
set -l out (sv status $services 2>/dev/null)
and string replace -r "^(\w+: )(.*?):" '$2\t$1$2:' $out
or printf "%s\n" $services
end
complete -f -c sv -a "(__fish_complete_sv_list_services)" -n "__fish_seen_subcommand_from $commands"
complete -fc sv -s v -d "Report status for up, down, term, once, cont, and exit"
complete -fc sv -s w -d "Override the default timeout to report status"
set -l no_comm "not __fish_seen_subcommand_from $commands"
complete -kfc sv -n $no_comm -a check -d "Check if the service is in it's requested state"
complete -kfc sv -n $no_comm -a try-restart -d "Run term, cont, and up, report status"
complete -kfc sv -n $no_comm -a force-shutdown -d "Run exit, report status or kill on timeout"
complete -kfc sv -n $no_comm -a force-restart -d "Run term, cont and up, report status"
complete -kfc sv -n $no_comm -a force-reload -d "Run term and cont, report status"
complete -kfc sv -n $no_comm -a force-stop -d "Run down, report status or kill on timeout"
complete -kfc sv -n $no_comm -a shutdown -d "Run exit, report status"
complete -kfc sv -n $no_comm -a restart -d "Run term, cont, and up, report status using ./check"
complete -kfc sv -n $no_comm -a reload -d "Run hup, report status"
complete -kfc sv -n $no_comm -a stop -d "Run down, report status"
complete -kfc sv -n $no_comm -a start -d "Run up, report status"
complete -kfc sv -n $no_comm -a e -d "Alias for exit"
complete -kfc sv -n $no_comm -a k -d "Alias for kill"
complete -kfc sv -n $no_comm -a t -d "Alias for term"
complete -kfc sv -n $no_comm -a 2 -d "Alias for 2"
complete -kfc sv -n $no_comm -a 1 -d "Alias for 1"
complete -kfc sv -n $no_comm -a q -d "Alias for quit"
complete -kfc sv -n $no_comm -a i -d "Alias for interrupt"
complete -kfc sv -n $no_comm -a a -d "Alias for alarm"
complete -kfc sv -n $no_comm -a h -d "Alias for hup"
complete -kfc sv -n $no_comm -a c -d "Alias for cont"
complete -kfc sv -n $no_comm -a p -d "Alias for pause"
complete -kfc sv -n $no_comm -a exit -d "Send TERM, and CONT, report status"
complete -kfc sv -n $no_comm -a kill -d "Send SIGKILL"
complete -kfc sv -n $no_comm -a term -d "Send SIGTERM"
complete -kfc sv -n $no_comm -a 2 -d "Send SIGUSR2"
complete -kfc sv -n $no_comm -a 1 -d "Send SIGUSR1"
complete -kfc sv -n $no_comm -a quit -d "Send SIGQUIT"
complete -kfc sv -n $no_comm -a interrupt -d "Send SIGINT"
complete -kfc sv -n $no_comm -a alarm -d "Send SIGALRM"
complete -kfc sv -n $no_comm -a hup -d "Send SIGHUP"
complete -kfc sv -n $no_comm -a cont -d "Send SIGCONT"
complete -kfc sv -n $no_comm -a pause -d "Send SIGSTOP"
complete -kfc sv -n $no_comm -a o -d "Alias for once"
complete -kfc sv -n $no_comm -a d -d "Alias for down"
complete -kfc sv -n $no_comm -a u -d "Alias for up"
complete -kfc sv -n $no_comm -a s -d "Alias for status"
complete -kfc sv -n $no_comm -a once -d "Start service, but don't restart it"
complete -kfc sv -n $no_comm -a down -d "Send it the TERM signal"
complete -kfc sv -n $no_comm -a up -d "Start a service"
complete -kfc sv -n $no_comm -a status -d "Report the current status of the service"

View File

@@ -12,7 +12,7 @@ if sysctl -h >/dev/null 2>/dev/null
complete -c sysctl -s N -l names -d 'Only print names'
complete -c sysctl -s q -l quiet -d 'Be quiet when setting values'
complete -c sysctl -s w -l write -d 'Write value'
complete -c sysctl -o 'p[FILE]' -l 'load[' -d 'Load in sysctl settings from the file specified or /etc/sysctl'
complete -c sysctl -s p -l load -d 'Load in sysctl settings from the file specified or /etc/sysctl'
complete -c sysctl -s a -l all -d 'Display all values currently available'
complete -c sysctl -l deprecated -d 'Include deprecated parameters too'
complete -c sysctl -s b -l binary -d 'Print value without new line'

View File

@@ -66,7 +66,7 @@ complete -c tmux -n "__fish_seen_subcommand_from $detach" -s P -d 'SIGHUP parent
complete -c tmux -n __fish_use_subcommand -a $has -d 'report error and exit with 1 if the session does not exist'
complete -c tmux -n __fish_use_subcommand -a $killserver -d 'kill tmux server, clients, and sessions'
complete -c tmux -n __fish_use_subcommand -a $killsession -d 'destroy session, closing windows linked to it, and detach all clients'
complete -c tmux -n __fish_use_subcommand -a $killsession -d 'destroy session, close its windows, and detach all its clients'
complete -c tmux -n __fish_use_subcommand -a $lsc -d 'list all attached clients'
complete -c tmux -n __fish_use_subcommand -a $lscm -d 'list syntax for all tmux commands'
complete -c tmux -n __fish_use_subcommand -a $ls -d 'list all sessions'

View File

@@ -21,30 +21,30 @@ complete -c vbc -o optimize- -d "Disable optimizations"
# Output files
complete -c vbc -o doc -o "doc:" -o "doc+" -d "Process documentation comments to an XML file"
complete -c vbc -o doc- -d "Disable -doc"
complete -c vbc -o deterministic -d "Causes the compiler to output an assembly whose binary content is identical across compilations if inputs are identical"
complete -c vbc -o deterministic -d "Output identical assemblies for identical inputs"
complete -c vbc -o netcf -d "Sets the compiler to target the .NET Compact Framework"
complete -c vbc -o "out:" -d "Specifies an output file"
complete -c vbc -o refonly -d "Outputs only a reference assembly"
complete -c vbc -o "refout:" -d "Specifies the output path of a reference assembly"
complete -c vbc -o "t:exe" -o "target:exe" -d "Causes the compiler to create an executable console application (default)"
complete -c vbc -o "t:library" -o "target:library" -d "Causes the compiler to create a dynamic-link library (DLL)"
complete -c vbc -o "t:module" -o "target:module" -d "Causes the compiler to generate a module that can be added to an assembly"
complete -c vbc -o "t:winexe" -o "target:winexe" -d "Causes the compiler to create an executable Windows-based application"
complete -c vbc -o "t:appcontainerexe" -o "target:appcontainerexe" -d "Causes the compiler to create an executable Windows-based application that must be run in an app container"
complete -c vbc -o "t:winmdobj" -o "target:winmdobj" -d "Causes the compiler to create an intermediate file that you can convert to a Windows Runtime binary (.winmd) file"
complete -c vbc -o "t:exe" -o "target:exe" -d "Create a console application"
complete -c vbc -o "t:library" -o "target:library" -d "Create a dynamic-link library"
complete -c vbc -o "t:module" -o "target:module" -d "Create a module that can be added to an assembly"
complete -c vbc -o "t:winexe" -o "target:winexe" -d "Create Windows application"
complete -c vbc -o "t:appcontainerexe" -o "target:appcontainerexe" -d "Create Windows application that must be run in an app container"
complete -c vbc -o "t:winmdobj" -o "target:winmdobj" -d "Create an intermediate file that can be converted to .winmd file"
# .NET assemblies
complete -c vbc -o "addmodule:" -d "Causes the compiler to make all type information from the specified file(s) available to the project you are currently compiling"
complete -c vbc -o "addmodule:" -d "Add type information from provided files to the project"
complete -c vbc -o delaysign -o "delaysign+" -d "Specifies whether the assembly will be fully or partially signed"
complete -c vbc -o delaysign- -d "Disable -delaysign"
complete -c vbc -o "imports:" -d "Imports a namespace from a specified assembly"
complete -c vbc -o "keycontainer:" -d "Specifies a key container name for a key pair to give an assembly a strong name"
complete -c vbc -o "keyfile:" -d "Specifies a file containing a key or key pair to give an assembly a strong name"
complete -c vbc -o "keycontainer:" -d "Specify a strong name key container"
complete -c vbc -o "keyfile:" -d "Specify a strong name key file"
complete -c vbc -o "libpath:" -d "Specifies the location of assemblies referenced by the -reference option"
complete -c vbc -o "r:" -o "reference:" -d "Imports metadata from an assembly"
complete -c vbc -o "moduleassemblyname:" -d "Specifies the name of the assembly that a module will be a part of"
complete -c vbc -o "a:" -o "analyzer:" -d "Run the analyzers from this assembly"
complete -c vbc -o "additionalfile:" -d "Names additional files that don't directly affect code generation but may be used by analyzers for producing errors or warnings"
complete -c vbc -o "additionalfile:" -d "Files that analyzers can use to generate error or warning"
# Debugging/error checking
complete -c vbc -o "bugreport:" -d "Creates a file that contains information that makes it easy to report a bug"
@@ -56,7 +56,7 @@ end
complete -c vbc -o debug- -d "Disable -debug"
complete -c vbc -o nowarn -o "nowarn:" -d "Suppresses the compiler's ability to generate warnings"
complete -c vbc -o quiet -d "Prevents the compiler from displaying code for syntax-related errors and warnings"
complete -c vbc -o quiet -d "Don't display code for syntax-related errors and warnings"
complete -c vbc -o removeintchecks -o "removeintchecks+" -d "Disables integer overflow checking"
complete -c vbc -o removeintchecks- -d "Disable -removeintchecks"
complete -c vbc -o warnaserror -o "warnaserror:" -o "warnaserror+" -o "warnaserror+:" -d "Promotes warnings to errors"
@@ -89,7 +89,7 @@ complete -c vbc -o optionstrict -o "optionstrict+" -o "optionstrict:" -d "Enforc
complete -c vbc -o optionstrict- -d "Disable -optionstrict"
for arguments in binary text
complete -c vbc -o "optioncompare:$arguments" -d "Specifies whether string comparisons should be binary or use locale-specific text semantics"
complete -c vbc -o "optioncompare:$arguments" -d "Specify string comparison mode: text or binary"
end
complete -c vbc -o optioninfer -o "optioninfer+" -d "Enables the use of local type inference in variable declarations"
@@ -106,35 +106,35 @@ complete -c vbc -o "win32resource:" -d "Inserts a Win32 resource into the output
# Miscellaneous
complete -c vbc -o "baseaddress:" -d "Specifies the base address of a DLL"
complete -c vbc -o "codepage:" -d "Specifies the code page to use for all source code files in the compilation"
complete -c vbc -o "codepage:" -d "Specify the code page for source code files"
for arguments in prompt queue send none
complete -c vbc -o "errorreport:$arguments" -d "Specifies how the Visual Basic compiler should report internal compiler errors"
complete -c vbc -o "errorreport:$arguments" -d "Specify how to report internal compiler errors"
end
complete -c vbc -o highentropyva -o "highentropyva+" -d "Tells the Windows kernel whether a particular executable supports high entropy Address Space Layout Randomization (ASLR)"
complete -c vbc -o highentropyva -o "highentropyva+" -d "Specify if an executable supports high entropy ASLR"
complete -c vbc -o highentropyva- -d "Disable -highentropyva"
complete -c vbc -o "m:" -o "main:" -d "Specifies the class that contains the Sub Main procedure to use at startup"
complete -c vbc -o noconfig -d "Do not compile with Vbc.rsp"
complete -c vbc -o nostdlib -d "Causes the compiler not to reference the standard libraries"
complete -c vbc -o nowin32manifest -d "Instructs the compiler not to embed any application manifest into the executable file"
complete -c vbc -o "platform:x86" -d "Specify x86 as the processor platform the compiler targets for the output file"
complete -c vbc -o "platform:x64" -d "Specify AMD64 or EM64T as the processor platform the compiler targets for the output file"
complete -c vbc -o "platform:Itanium" -d "Specify Itanium as the processor platform the compiler targets for the output file"
complete -c vbc -o "platform:arm" -d "Specify ARM as the processor platform the compiler targets for the output file"
complete -c vbc -o "platform:anycpu" -d "Specify any platform as the processor platform the compiler targets for the output file (default)"
complete -c vbc -o "platform:anycpu32bitpreferred" -d "Specify any platform as the processor platform the compiler targets for the output file"
complete -c vbc -o nowin32manifest -d "Don't embed any application manifest into the executable"
complete -c vbc -o "platform:x86" -d "Specify x86 as target platform"
complete -c vbc -o "platform:x64" -d "Specify AMD64 or EM64T as target platform"
complete -c vbc -o "platform:Itanium" -d "Specify Itanium as target platform"
complete -c vbc -o "platform:arm" -d "Specify ARM as target platform"
complete -c vbc -o "platform:anycpu" -d "Specify any platform as target"
complete -c vbc -o "platform:anycpu32bitpreferred" -d "Specify any platform as target (32-bit process on 64-bit machine)"
complete -c vbc -o "recurse:" -d "Searches subdirectories for source files to compile"
complete -c vbc -o "rootnamespace:" -d "Specifies a namespace for all type declarations"
complete -c vbc -o "sdkpath:" -d "Specifies the location of Mscorlib.dll and Microsoft.VisualBasic.dll"
complete -c vbc -o "vbruntime:" -d "Specifies that the compiler should compile without a reference to the Visual Basic Runtime Library, or with a reference to a specific runtime library"
complete -c vbc -o "vbruntime:" -d "Specify reference to VB Runtime Library or disable library referencing"
for arguments in - + "*"
complete -c vbc -o "vbruntime:$arguments" -d "Specifies that the compiler should compile without a reference to the Visual Basic Runtime Library, or with a reference to a specific runtime library"
complete -c vbc -o "vbruntime:$arguments" -d "Specify reference to VB Runtime Library or disable library referencing"
end
complete -c vbc -o "win32manifest:" -d "Identifies a user-defined Win32 application manifest file to be embedded into a project's portable executable (PE) file"
complete -c vbc -o "win32manifest:" -d "Provide application manifest file"
complete -c vbc -o parallel -o "parallel+" -d "Specifies whether to use concurrent build"
complete -c vbc -o parallel- -d "Disable -parallel"
complete -c vbc -o "checksumalgorithm:SHA1" -d "Specify SHA1 as the algorithm for calculating the source file checksum stored in PDB (default)"
complete -c vbc -o "checksumalgorithm:SHA256" -d "Specify SHA256 as the algorithm for calculating the source file checksum stored in PDB"
complete -c vbc -o "checksumalgorithm:SHA1" -d "Use SHA1 to calculate the source file checksum"
complete -c vbc -o "checksumalgorithm:SHA256" -d "Use SHA256 to calculate the source file checksum"

View File

@@ -4,39 +4,49 @@ if not type -q apropos
exit
end
function __fish_apropos
# macOS 10.15 "Catalina" has some major issues.
# The whatis database is non-existent, so apropos tries (and fails) to create it every time,
# which takes about half a second.
#
# Instead, we build a whatis database in the user cache directory
# and override the MANPATH using that directory before we run `apropos`
#
# the cache is rebuilt once a day
if test (uname) = Darwin
set -l cache $HOME/.cache/fish/
if test -n "$XDG_CACHE_HOME"
set cache $XDG_CACHE_HOME/fish
end
# Check for macOS Catalina or above. This is Darwin 19.x or above. See unames reported here:
# https://en.wikipedia.org/wiki/Darwin_(operating_system)
set -l sysver (uname -sr | string match -r "(Darwin) (\d\d)"\.)
set -l db $cache/whatis
set -l max_age 86400 # one day
if test $status -eq 0 -a (count $sysver) -eq 3
and test $sysver[2] = 'Darwin' -a $sysver[3] -ge 19
set -l dir
if test -n "$XDG_CACHE_HOME"
set dir $XDG_CACHE_HOME/fish
else
set dir (getconf DARWIN_USER_CACHE_DIR)"fish"
end
function __fish_apropos -V dir
# macOS 10.15 "Catalina" has a read only filesystem where the whatis database should be.
# The whatis database is non-existent, so apropos tries (and fails) to create it every time,
# which can take seconds.
#
# Instead, we build a whatis database in the user cache directory
# and override the MANPATH using that directory before we run `apropos`
#
# the cache is rebuilt once a week.
set -l whatis $dir/whatis
set -l max_age 600000 # like a week
set -l age $max_age
if test -f "$db"
if test -f "$whatis"
# Some people use GNU tools on macOS, and GNU stat works differently.
# However it's currently guaranteed that the macOS stat is in /usr/bin,
# so we use that explicitly.
set age (math (date +%s) - (/usr/bin/stat -f %m $db))
set age (math (date +%s) - (/usr/bin/stat -f %m $whatis))
end
MANPATH="$cache" apropos -- $argv
MANPATH="$dir" apropos "^$argv"
if test $age -ge $max_age
mkdir -m 700 -p $cache
/usr/libexec/makewhatis -o $db (man --path | string split :) >/dev/null 2>&1 </dev/null &
test -d "$dir" || mkdir -m 700 -p $dir
/usr/libexec/makewhatis -o "$whatis" (man --path | string split :) >/dev/null 2>&1 </dev/null &
end
else
apropos -- $argv
end
else
function __fish_apropos
apropos $argv
end
end

View File

@@ -1,5 +1,5 @@
# TODO: This function is deprecated. It was used in fish_clipboard_paste
# which some users copied, so maybe leave it around for a few years.
function __fish_commandline_is_singlequoted --description "Return 0 if the current token has an open single-quote"
string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct))
string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct | string collect))
end

View File

@@ -1,58 +1,114 @@
function __fish_complete_ssh -d "common completions for ssh commands" --argument-names command
complete -c $command -s 1 -d "Protocol version 1 only"
complete -c $command -s 2 -d "Protocol version 2 only"
complete -c $command -s 4 -d "IPv4 addresses only"
complete -c $command -s 6 -d "IPv6 addresses only"
complete -c $command -s 4 -d "IPv4 only"
complete -c $command -s 6 -d "IPv6 only"
complete -c $command -s A -d "Enables forwarding of the authentication agent"
complete -c $command -s C -d "Compress all data"
complete -xc $command -s c -d "Encryption algorithm" -a "blowfish 3des des"
complete -r -c $command -s F -d "Configuration file"
complete -r -c $command -s i -d "Identity file"
complete -x -c $command -s o -d Options -a "
AddressFamily
BatchMode
BindAddress
ChallengeResponseAuthentication
CheckHostIP
Cipher
Ciphers
Compression
CompressionLevel
ConnectionAttempts
ConnectTimeout
ControlMaster
ControlPath
GlobalKnownHostsFile
GSSAPIAuthentication
GSSAPIDelegateCredentials
Host
HostbasedAuthentication
HostKeyAlgorithms
HostKeyAlias
HostName
IdentityFile
IdentitiesOnly
LogLevel
MACs
NoHostAuthenticationForLocalhost
NumberOfPasswordPrompts
PasswordAuthentication
Port
PreferredAuthentications
Protocol
ProxyCommand
PubkeyAuthentication
RhostsRSAAuthentication
RSAAuthentication
SendEnv
ServerAliveInterval
ServerAliveCountMax
SmartcardDevice
StrictHostKeyChecking
TCPKeepAlive
UsePrivilegedPort
User
UserKnownHostsFile
VerifyHostKeyDNS
"
complete -c $command -s c -d "Encryption algorithm" -xa "(__fish_complete_list , __fish_ssh_ciphers)"
complete -c $command -s F -d "Configuration file" -rF
complete -c $command -s i -d "Identity key file" -rF
complete -c $command -s J -d 'ProxyJump host' -xa "(__fish_complete_user_at_hosts)"
complete -c $command -s o -d Options -xa "
AddKeysToAgent
AddressFamily
BatchMode
BindAddress
BindInterface
CanonicalDomains
CanonicalizeFallbackLocal
CanonicalizeHostname
CanonicalizeMaxDots
CanonicalizePermittedCNAMEs
CASignatureAlgorithms
CertificateFile
ChallengeResponseAuthentication
CheckHostIP
Ciphers
ClearAllForwardings
Compression
ConnectionAttempts
ConnectTimeout
ControlMaster
ControlPath
ControlPersist
DynamicForward
EscapeChar
ExitOnForwardFailure
FingerprintHash
ForwardAgent
ForwardX11
ForwardX11Timeout
ForwardX11Trusted
GatewayPorts
GlobalKnownHostsFile
GSSAPIAuthentication
GSSAPIClientIdentity
GSSAPIDelegateCredentials
GSSAPIKexAlgorithms
GSSAPIKeyExchange
GSSAPIRenewalForcesRekey
GSSAPIServerIdentity
GSSAPITrustDns
HashKnownHosts
Host
HostbasedAuthentication
HostbasedKeyTypes
HostKeyAlgorithms
HostKeyAlias
Hostname
IdentitiesOnly
IdentityAgent
IdentityFile
IPQoS
KbdInteractiveAuthentication
KbdInteractiveDevices
KexAlgorithms
LocalCommand
LocalForward
LogLevel
MACs
Match
NoHostAuthenticationForLocalhost
NumberOfPasswordPrompts
PasswordAuthentication
PermitLocalCommand
PKCS11Provider
Port
PreferredAuthentications
ProxyCommand
ProxyJump
ProxyUseFdpass
PubkeyAcceptedKeyTypes
PubkeyAuthentication
RekeyLimit
RemoteCommand
RemoteForward
RequestTTY
SendEnv
ServerAliveCountMax
ServerAliveInterval
SetEnv
StreamLocalBindMask
StreamLocalBindUnlink
StrictHostKeyChecking
TCPKeepAlive
Tunnel
TunnelDevice
UpdateHostKeys
User
UserKnownHostsFile
VerifyHostKeyDNS
VisualHostKey
XAuthLocation
"
complete -c $command -s q -d "Quiet mode"
complete -c $command -s v -d "Verbose mode"
end
function __fish_ssh_ciphers -d "List of possible SSH cipher algorithms"
ssh -Q cipher
end
function __fish_ssh_macs -d "List of possible SSH MAC algorithms"
ssh -Q mac
end

View File

@@ -62,7 +62,7 @@ function __fish_config_interactive -d "Initializations that should be performed
__init_uvar fish_color_cancel -r
# Pager colors
__init_uvar fish_pager_color_prefix white --bold --underline
__init_uvar fish_pager_color_prefix normal --bold --underline
__init_uvar fish_pager_color_completion
__init_uvar fish_pager_color_description B3A06D yellow
__init_uvar fish_pager_color_progress brwhite --background=cyan
@@ -235,6 +235,8 @@ function __fish_config_interactive -d "Initializations that should be performed
if set -q VTE_VERSION
# Same for alacritty
or string match -q -- 'alacritty*' $TERM
# Same for kitty
or string match -q -- '*kitty' $TERM
set -g fish_handle_reflow 0
else if set -q KONSOLE_VERSION
and test "$KONSOLE_VERSION" -ge 210400 2>/dev/null
@@ -266,6 +268,16 @@ function __fish_config_interactive -d "Initializations that should be performed
__update_cwd_osc # Run once because we might have already inherited a PWD from an old tab
end
# Create empty configuration directores if they do not already exist
test -e $__fish_config_dir/completions/ -a -e $__fish_config_dir/conf.d/ -a -e $__fish_config_dir/functions/ ||
mkdir -p $__fish_config_dir/{completions, conf.d, functions}
# Create config.fish with some boilerplate if it does not exist
test -e $__fish_config_dir/config.fish || echo "\
if status is-interactive
# Commands to run in interactive sessions can go here
end" >$__fish_config_dir/config.fish
# Bump this whenever some code below needs to run once when upgrading to a new version.
# The universal variable __fish_initialized is initialized in share/config.fish.
set __fish_initialized 3100

View File

@@ -1,5 +1,5 @@
# determine if this is the very first argument (regardless if switch or not)
function __fish_is_first_arg
set -l tokens (commandline -co)
set -l tokens (commandline -poc)
test (count $tokens) -eq 1
end

View File

@@ -2,7 +2,7 @@
# of the directory under the cursor.
function __fish_list_current_token -d "List contents of token under the cursor if it is a directory, otherwise list the contents of the current directory"
set -l val (eval echo (commandline -t))
set -l val (commandline -t)
printf "\n"
if test -d $val
ls $val

View File

@@ -6,7 +6,9 @@ function __fish_make_completion_signals --description 'Make list of kill signals
# Cygwin's kill is special, and the documentation lies.
# Just hardcode the signals.
if uname | string match -q 'CYGWIN*'
set -l os (uname)
if string match -q 'CYGWIN*' -- $os
or string match -iq 'Msys' -- $os
set -a __kill_signals "1 HUP" "2 INT" "3 QUIT" "4 ILL" "5 TRAP" "6 ABRT" \
"6 IOT" "7 BUS" "8 FPE" "9 KILL" "10 USR1" "11 SEGV" \
"12 USR2" "13 PIPE" "14 ALRM" "15 TERM" "16 STKFLT" "17 CHLD" \

View File

@@ -18,12 +18,24 @@ function __fish_man_page
# Try "man first-second" and fall back to "man first" if that doesn't work out.
set -l maincmd (basename $args[1])
if set -q args[2]
man "$maincmd-$args[2]" 2>/dev/null
or man "$maincmd" 2>/dev/null
or printf \a
# HACK: If stderr is not attached to a terminal `less` (the default pager)
# wouldn't use the alternate screen.
# But since we don't know what pager it is, and because `man` is totally underspecified,
# the best we can do is to *try* the man page, and assume that `man` will return false if it fails.
# See #7863.
if man "$maincmd-$args[2]" &>/dev/null
man "$maincmd-$args[2]"
else if man "$maincmd" &>/dev/null
man "$maincmd"
else
printf \a
end
else
man "$maincmd" 2>/dev/null
or printf \a
if man "$maincmd" &>/dev/null
man "$maincmd"
else
printf \a
end
end
commandline -f repaint

View File

@@ -1,16 +1,8 @@
function __fish_paginate -d "Paginate the current command using the users default pager"
set -l cmd less
if set -q PAGER
echo $PAGER | read -at cmd
end
if test -z (commandline -j | string join '')
commandline -i $history[1]
end
if commandline -j | not string match -q -r "$cmd *\$"
commandline -aj " &| $cmd;"
end
fish_commandline_append " &| $cmd"
end

View File

@@ -1,14 +1,3 @@
function __fish_prepend_sudo -d "Prepend 'sudo ' to the beginning of the current commandline"
set -l cmd (commandline -po)
set -l cursor (commandline -C)
if test -z "$cmd"
commandline -r "sudo $history[1]"
else if test "$cmd[1]" != sudo
commandline -C 0
commandline -i "sudo "
commandline -C (math $cursor + 5)
else
commandline -r (string sub --start=6 (commandline -p))
commandline -C -- (math $cursor - 5)
end
function __fish_prepend_sudo -d " DEPRECATED: use fish_commandline_prepend instead. Prepend 'sudo ' to the beginning of the current commandline"
fish_commandline_prepend sudo
end

View File

@@ -111,7 +111,7 @@ function __fish_print_help --description "Print help message for the specified f
end
end
end
end | string replace -ra '^ ' '' | ul | # post-process with `ul`, to interpret the old-style grotty escapes
end | string replace -ra '^ ' '' |
begin
set -l pager less
set -q PAGER
@@ -119,13 +119,13 @@ function __fish_print_help --description "Print help message for the specified f
not isatty stdout
and set pager cat # cannot use a builtin here
# similar to man, but add -F to quit paging when the help output is brief (#6227)
set -xl LESS isrFX
not set -qx LESS
and set -xl LESS isRF
# less options:
# -i (--ignore-case) search case-insensitively, like man
# -s (--squeeze-blank-lines) not strictly necessary since we already do that above
# -r (--raw-control-chars) to display bold, underline and colors
# -R (--RAW-CONTROL-CHARS) to display colors and such
# -F (--quit-if-one-screen) to maintain the non-paging behavior for small outputs
# -X (--no-init) not sure if this is needed but git uses it
$pager
end
end

View File

@@ -1,15 +1,8 @@
switch (uname)
case 'CYGWIN_*'
function __fish_pwd --description "Show current path"
if status test-feature regex-easyesc
pwd | string replace -r '^/cygdrive/(.)?' '\U$1:'
else
# TODO: Remove this once regex-easyesc becomes the default
pwd | string replace -r '^/cygdrive/(.)?' '\\\U$1:'
end
end
case '*'
function __fish_pwd --description "Show current path"
pwd
end
function __fish_pwd --description "Show current path"
if status test-feature regex-easyesc
string replace -r '^/cygdrive/(.)?' '\U$1:' -- $PWD
else
# TODO: Remove this once regex-easyesc becomes the default
string replace -r '^/cygdrive/(.)?' '\\\U$1:' -- $PWD
end
end

View File

@@ -10,7 +10,7 @@
function __fish_set_locale
set -l LOCALE_VARS
set -a LOCALE_VARS LANG LANGUAGE LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE
set -a LOCALE_VARS LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE
set -a LOCALE_VARS LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS
set -a LOCALE_VARS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION

View File

@@ -98,8 +98,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod
bind --preset $argv \ed 'set -l cmd (commandline); if test -z "$cmd"; echo; dirh; commandline -f repaint; else; commandline -f kill-word; end'
bind --preset $argv \cd delete-or-exit
# Prepend 'sudo ' to the current commandline
bind --preset $argv \es __fish_prepend_sudo
bind --preset $argv \es "fish_commandline_prepend sudo"
# Allow reading manpages by pressing F1 (many GUI applications) or Alt+h (like in zsh).
bind --preset $argv -k f1 __fish_man_page
@@ -182,7 +181,7 @@ function __fish_start_bracketed_paste
set -g __fish_last_bind_mode $fish_bind_mode
# If the token is currently single-quoted,
# we escape single-quotes (and backslashes).
__fish_commandline_is_singlequoted
string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct | string collect))
and set -g __fish_paste_quoted 1
end

View File

@@ -10,7 +10,7 @@
function __fish_toggle_comment_commandline --description 'Comment/uncomment the current command'
set -l cmdlines (commandline -b)
if test "$cmdlines" = ""
history search -p "#" -z | read -z cmdlines
set cmdlines (history search -p "#" --max=1)
end
set -l cmdlines (printf '%s\n' '#'$cmdlines | string replace -r '^##' '')
commandline -r $cmdlines

View File

@@ -35,10 +35,10 @@ function alias --description 'Creates a function wrapping a command'
# sanity check
if test -z "$name"
printf ( _ "%s: Name cannot be empty\n") alias
printf ( _ "%s: Name cannot be empty\n") alias >&2
return 1
else if test -z "$body"
printf ( _ "%s: Body cannot be empty\n") alias
printf ( _ "%s: Body cannot be empty\n") alias >&2
return 1
end

View File

@@ -16,5 +16,4 @@ function dirs --description 'Print directory stack'
# Replace $HOME with ~.
string replace -r '^'"$HOME"'($|/)' '~$1' -- $PWD $dirstack | string join " "
echo
end

View File

@@ -29,7 +29,10 @@ function fish_add_path --description "Add paths to the PATH"
end
set -l var fish_user_paths
set -q _flag_path; and set var PATH
set -q _flag_path
and set var PATH
# $PATH should be global
and set scope -g
set -l mode $_flag_prepend $_flag_append
set -q mode[1]; or set mode -p

View File

@@ -11,6 +11,10 @@ if test -r /etc/os-release
string replace -r '^ID(?:_LIKE)?\s*=(.*)' '$1' | string trim -c '\'"' | string split " ")
end
function __fish_default_command_not_found_handler
printf "fish: Unknown command: %s\n" (string escape -- $argv[1]) >&2
end
# If an old handler already exists, defer to that.
if functions -q __fish_command_not_found_handler
function fish_command_not_found

Some files were not shown because too many files have changed in this diff Show More