Remove some nonexistent options (my gcc does not know "-mdata"), fix
the longest description in all of fish and remove some argument
markers from the option.
It's using GNU specific flags, which doesn't work on BSDs like macOS.
Instead this just formats the current time into
seconds and then the `math` builtin for calculating the 5 min timeout.
Git completions use wrapper function __fish_git instead of directly
running git. This allows them to be aware of Git's global options, like
--git-dir. Let's use __fish_git also for listing config keys & values,
so it can more accurately list local (= per repo) git configuration.
We don't provide completions on "git config " because we require
"fish_is_nth_token 3". Confusingly, fish_is_nth_token only counts
tokens *before* the cursor, so 2 is the right number here.
While at it, fix a typo and delete an unused completion entry (it
ran conditional on __fish_is_first_arg, which is always false for a
git subcommand).
This patch introduces basic completion of the -pl|--projects switch for
mvn. The implementation is quite naive but it's better than nothing. A more
robust implementation would require either scanning the filesystem or running
mvn which might slow down completion significantly.
This solution can be improved by using an XML parser instead of grep/sed.
* add --bold, --italics, all of them,
* and we add them as arguments so that they are do not
render like long options, they are just self-descriptive
literal strings in this context.
* solve an unneccessary global var.
Fixes#8518
Use the remaining_to_disclose count to determine if all completions
are shown (allows consistent behavior between short and long completion
lists).
Closes#8485
Cargo subcommand extensions don't provide a description in `cargo --list`,
the regex used to filter this list ignored lines without a description.
This change fixes that.
A completion entry like «complete -a '\\~'» results in completions
that insert \~ into the command line. However we usually want to
insert ~, but there is no way to do that.
There are a couple of longstanding issues about completion escaping
[1]. Until we fix those in a general way, fix the common case by
never escaping tildes when applying custom completions to the command
line. This is a hack but will probably work out fine because we don't
expect literal tildes in arguments.
The tilde is included in completions for cdh, or
__fish_complete_suffix, which simply forwards results from "complete
-C". Revert a workaround to cdh that expanded ~, because we can now
render that without escaping.
Closes#4570, #8441
[ja: tweak patch and commit message]
[1]: https://github.com/fish-shell/fish-shell/pull/8441#discussion_r748803338
* Rename pabcnetcclear complete
* Code clean-up
* Debug values support
* Change /Debug description
* Standardize help
* Use single quotes for --arguments
* Add findstr completion
* Standardize completion
* Show completion only on Windows
* Use single quotes where possible
* Remove quotes where possible
* Remove OS check
* Use single quotes for --arguments
This was "--authoritative" (and unauthoritative). It was meant to make
fish mark everything that couldn't be generated via the completions as
an error, it was removed years ago and has been a no-op since then.
This behavior matches the way completions are found for `cargo run`,
`cargo test`, etc., and is more robust and correct compared to looking
at filenames.
This program uses the Cobra framework for argument parsing and completion generation.
Just source the completions supplied by upstream.
This works around "go install" not being able to install completions files (only binaries).
Usually local branches have remote branches with the same name, and in
completion they are currently overshadowed by unique remote branches, making
local branches hard to find. Define local branch completion after unique
remote branch completion to show local branches before unique remote branches.
If $xdg_chache_home is empty, this is not a valid fish expression:
[ \( -z \) -o \( ! -d \) ]
and results into an error.
While at it, also use $XDG_CACHE_HOME if that directory does not exist.
This seems better than falling back to $HOME/.cache, which the user has
explicitly overridden via $XDG_CACHE_HOME.
Suggest files to "man -l", but only if the "-l" option is supported
(so not on BSD). Technically we should accept multiple files but this
seems good enough.
Also suggest files when the token-at-cursor contains a slash, because
man will treat arguments as file paths if they contain a /.
git-status --porcelain prints status letter T when a file changed type
between either regular file, symlink or submodule. It can occur in
exactly the same cases as M (modified), so extend the fix for #8311
accordingly.
For submodules, our completions are probably not always correct,
hopefully those cases are rare.
This is weirdly undocumented (as of git 2.33.0), but `git status` prints a "T" state if
the file has its "T"ype changed, e.g. from a regular file to a symlink.
For our purposes that's just another kind of modification.
Fixes#8311.
* Fix ls.fish: add -l option to GNU ls
* Sort alphabetically and remove --lcontext and --scontext (what are these?) on shared and GNU part.
* Revert --lcontext and --scontext options.
The same hack that is used for `pkg remove <foo>` is required here, too.
Due to the massive number of results, we use `head -n 250` to prevent
the completion from hanging or the shell from being overencumbered by
too many possibe completions. However, this would only generate matches
for any of the first 250 packages, rather than printing the first 250
packages that match.
[ci skip]
support for ping from iputils (version 20210202)
support for ping from inetutils (version 2.1)
support for ping from busybox (version 1.33.1)
support for ping from FreeBSD and macOS (by @juntuu)
We keep __fish_is_nth_token for compatibility and edit the
implementations of __fish_is_nth_token, __fish_is_first_token and
__fish_is_token_n to use fish_is_nth_token
Using `complete -F -c git -n __fish_git_needs_subcommand -a $command -d
$description` causes file completions to be forced on entire git command
which is not a desired result. Morever without the `-F` flag file
completions work just as expected and is useless addition
`fish_config theme`:
- `list` to list all available themes (files in the two theme
directories - either the web_config/themes one or
~/.config/fish/themes!)
- `show` to show select (or all) themes right in the terminal - this
starts another fish that reads the theme file and prints the sample
text, manually colored
- `choose` to load a theme *now*, setting the variables globally
- `save` to load a theme and save the variables universally
- `dump` to write the current theme in .theme format (to stdout)
- `demo` to display the current theme
* Add initial completion for Angular CLI
* Remove completion for `ng completion`
The `ng completion` doesn't exist. The completiond were autogenerated
using a script. See angular/angular-cli#21085
* Use shorter wording
* Fix typos
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`
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`.
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.
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.
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.
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