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.