Compare commits

..

69 Commits

Author SHA1 Message Date
Fabian Boehm
acde38fed3 webconfig: Set a variable before
This fixes things if a theme is entirely empty.

Fixes #9590
2023-02-19 14:57:32 +01:00
bagohart
3dd8db281b Add tab completion for stow (#9571) 2023-02-18 18:37:45 +01:00
Delapouite
a29d760ca0 completions/systemctl: add import-environment command
Man page reference:
https://man.archlinux.org/man/systemctl.1#Environment_Commands
2023-02-18 18:36:30 +01:00
Xiretza
ba0bfb9df7 functions: list caller-exit handlers correctly
`functions --handlers-type caller-exit` did not list any functions, while
`functions --handlers-type process-exit` listed both process-exit and
caller-exit handlers:

$ echo (function foo --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo)

$ echo (function foo --on-job-exit caller; end; functions --handlers-type process-exit | grep foo)
caller-exit foo
2023-02-18 18:35:40 +01:00
Fabian Boehm
4a1a59c5a8 tests/git: Also give the email to stash
WHYYYYYYYY

(anyway this seems to affect old git versions since we only seem to
hit it on old Ubuntu)
2023-02-15 20:11:46 +01:00
Fabian Boehm
d32449fe2e tests/git: Don't silence error, give email
(otherwise git complains about "AUTHOR UNKNOWN HELP HELP HELP I CANNAE
DO ANYTHIN'")

(i also don't know why git is scottish in my imagination)
2023-02-15 19:50:45 +01:00
Sam Bull
ef3516ecdf Test displaying only stash count (#9573) 2023-02-15 19:32:50 +01:00
Fabian Boehm
5aaa1e69bc fish_git_prompt: Allow counting stash without full informative
Fixes #9572
2023-02-15 19:28:18 +01:00
NextAlone
dcc8147147 docs: add apkanalyzer to changelog
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-02-15 19:00:47 +01:00
NextAlone
176097cc49 completions/apkanalyzer: add completion for apkanalyzer
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-02-15 19:00:47 +01:00
rymrg
43b1be0579 Improve fossil prompt execution time (#9528)
* Improve prompt execution time

* Change status to changes

* Remove grep/awk/sort

* Remove calls to grep/awk/sort
* Don't overwrite user defined colors

* Make look more consistent with git
2023-02-15 18:52:05 +01:00
Fabian Boehm
9c8b50cb8f docs: Make some code lines shorter
For code, we need to limit the length because it can't be reflowed automatically
2023-02-15 18:50:28 +01:00
Fabian Boehm
811dbf0f9a docs: More on dereferencing variables
Also that unclosed quote was driving me up the wall
2023-02-15 18:29:14 +01:00
Fabian Boehm
cbc66fe6ea completions: More shortened descriptions 2023-02-14 21:16:22 +01:00
Fabian Boehm
d9a9fb50d0 completions/cargo: Descriptions 2023-02-14 21:04:05 +01:00
Fabian Boehm
902782b1f4 completions/rsync: Remove one thing that isn't an option 2023-02-14 20:47:52 +01:00
Fabian Boehm
38b21fc1c7 completions/gcc: Shorten descriptions
Many of these are just entirely useless and I'm thinking of removing a
bunch of options.
2023-02-14 20:47:52 +01:00
mhmdanas
a67b089c89 completions/xbps-query: complete package name after -X 2023-02-14 20:32:33 +01:00
Fabian Boehm
4a8ebc0744 __fish_complete_path: Also use an empty command
This removes a weird `ls` call (that just decorates directories), and
makes it behave like normal path completion.

(really, this should be a proper option to complete)

Fixes #9285
2023-02-14 17:09:58 +01:00
Fabian Boehm
200095998a __fish_complete_directories: Use an empty command as the dummy
Fixes #9574
2023-02-14 17:09:58 +01:00
Jay
ce268b74dd completions/trash-cli: add completions for trash-cli (#9560)
Add completions for trash-cli commands:
trash, trash-empty, trash-list, trash-put and trash-restore.

``trash --help`` are used to identify the executable in trash cli completion.
2023-02-13 12:10:55 -06:00
esdmr
a607421912 functions --copy: store file and lineno (#9542)
Keeps the location of original function definition, and also stores
where it was copied. `functions` and `type` show both locations,
instead of none. It also retains the line numbers in the stack trace.
2023-02-13 09:59:28 -06:00
matt wartell
904839dcce fix 3 instances of old command substitution $() 2023-02-12 16:49:40 +01:00
Dmitry Gerasimov
c3a72111e9 completions/meson: rewrite meson completions (#9539)
Rewrite completions for meson to expose meson commands with their
options and subcommands. New completions are based on the meson 1.0.

Subcommands were introduced in meson 0.42.0 (August 2017), so new
completions will only work for versions after 0.42.0. At this moment,
even oldstable Debian (buster) has meson 0.49.2 -- which means it is
unlikely someone will be affected.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2023-02-11 17:58:45 -06:00
ridiculousfish
b7de768c73 Allow custom completions to have leading dots
By default, fish does not complete files that have leading dots, unless the
wildcard itself has a leading dot. However this also affected completions;
for example `git add` would not offer `.gitlab-ci.yml` because it has a
leading dot.

Relax this for custom completions. Default file expansion still
suppresses leading dots, but now custom completions can create
leading-dot completions and they will be offered.

Fixes #3707.
2023-02-11 11:27:14 -08:00
Fabian Boehm
b1b2294390 Add workaround for Midnight Commander's issue with prompt extraction
When we draw the prompt, we move the cursor to the actual
position *we* think it is by issuing a carriage return (via
`move(0,0)`), and then going forward until we hit the spot.

This helps when the terminal and fish disagree on the width of the
prompt, because we are now definitely in the correct place, so we can
only overwrite a bit of the prompt (if it renders longer than we
expected) or leave space after the prompt. Both of these are benign in
comparison to staircase effects we would otherwise get.

Unfortunately, midnight commander ("mc") tries to extract the last
line of the prompt, and does so in a way that is overly naive - it
resets everything to 0 when it sees a `\r`, and doesn't account for
cursor movement. In effect it's playing a terminal, but not committing
to the bit.

Since this has been an open request in mc for quite a while, we hack
around it, by checking the $MC_SID environment variable.

If we see it, we skip the clearing. We end up most likely doing
relative movement from where we think we are, and in most cases it
should be *fine*.
2023-02-11 14:18:10 +01:00
Fabian Boehm
7ac2fe2bd3 share/config: Erase on_interactive before doing __fish_config_interactive
This removes a possibility of an infinite loop where something in
__fish_config_interactive triggers a fish_prompt or fish_read event,
which calls __fish_on_interactive which calls
__fish_config_interactive again, ...

Fixes #9564
2023-02-11 14:15:44 +01:00
Fabian Boehm
24fb7ff67c completion/scons: Shorten descriptions 2023-02-10 21:10:05 +01:00
Fabian Boehm
4adb34d349 completions/dpkg-reconfigure: Don't run awkward things on source time
This wanted to get the default priority, and it ran a thing *at source
time*.

This can lead to a variety of errors and I don't believe it's all that
useful, so we remove it.
2023-02-10 20:58:58 +01:00
Fabian Boehm
85504ca694 completions/zfs: Check for zpool
This is an additional tool, and this function is executed on source
time so we'd spew errors.

(also remove an ineffective line - it's probably *nicer* with the
read, but that's not what's currently effectively doing anything)
2023-02-10 20:55:37 +01:00
Fabian Boehm
7d7b72f995 Use path basename instead of basename
This is faster and guaranteed to be available
2023-02-10 20:51:22 +01:00
Fabian Boehm
7b8684e469 completions/netcat: Use path 2023-02-10 20:50:14 +01:00
Fabian Boehm
cac483c67a completions: Quote some tests 2023-02-10 20:47:49 +01:00
Fabian Boehm
6fe4b0c24d completions/kb: Fix 2023-02-10 20:46:34 +01:00
NextAlone
c587b2ffcc completions/fastboot: fix flash completion
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-02-09 20:44:12 -08:00
bagohart
ef07e21d40 Add separate completions for neovim (#9543)
Separate the neovim completions from the vim ones, as their supported
options have diverged considerably.

Some documented options are not yet implemented, these are added but
commented out.

Closes #9535.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
2023-02-08 12:47:08 -06:00
Fabian Boehm
8ff78eddf0 man: Reroute ".",":","[" to the proper names
Fixes #9552
2023-02-07 19:23:26 +01:00
Fabian Boehm
e90f003d2d Silence ENODEV errors for fstatat
Some broken gdrive filesystem can return these.

Fixes #9550
2023-02-06 21:49:07 +01:00
Fabian Boehm
f6b390dc61 completions/git: Remove a for-loop
This is an easy win for `git add ` completion time if we have multiple descriptions.

What happened was we did things once per description string, but the
things included a bunch of computation (including multiple `string`
calls and even a `realpath`!). Because these don't change, we can
simply do them once.

And it turns out we can just use a cartesian product:

for d in $desc
    printf '%s\t%s\n' $file $d
end

becomes

printf '%s\n' $file\t$desc
2023-02-06 21:49:07 +01:00
Mahmoud Al-Qudsi
96deaae7d8 completions/apt: Read from the dpkg cache directly
I have no idea why `apt-cache --no-generate show` is so slow since it basically
dumps the contents of the cache file located at `/var/lib/dpkg/status`. We are
technically bypassing any waits on the cache lock file so this may produce
incorrect results if the cache is being regenerated in the moment, but that's a
small price to pay and the results are likely confined to simply not generating
comprehensive results.

With this change, we no longer need to truncate results to the first n matches
and we no longer only print packages beginning with the commandline argument
enabling fish's partial completions logic to offer less-perfect suggestions when
no better options are available.

Even though we are generating more usable completions, we still trounce the old
performance by leaps and bounds:

```
Benchmark #1: fish -c "complete -C\"apt install ac\""
  Time (mean ± σ):      2.165 s ±  0.033 s    [User: 267.0 ms, System: 1932.2 ms]
  Range (min … max):    2.136 s …  2.256 s    10 runs

Benchmark #2: build/fish -c "complete -C\"apt install ac\""
  Time (mean ± σ):     111.1 ms ±   1.8 ms    [User: 38.9 ms, System: 72.9 ms]
  Range (min … max):   108.2 ms … 114.9 ms    26 runs

Summary
  'build/fish -c "complete -C\"apt install ac\""' ran
   19.49 ± 0.44 times faster than 'fish -c "complete -C\"apt install ac\""'
```
2023-02-05 16:30:34 -06:00
Mahmoud Al-Qudsi
6f3711902b completions/apt: Use is_first_token instead of seen_subcommand_from
I think this should be preferred for all subcommand completions because it
handles typos or subcommands we don't recognize better (`apt foo <TAB>` no
longer suggests subcommands since the subcommand position has been taken).
2023-02-05 16:15:15 -06:00
NextAlone
3604e8854b completion/adb: remove wait-for-device from subcommand detect
wait-for-device should not be used in subcommand detect, cause it is used as seperate command, following with others.
2023-02-05 12:13:45 +01:00
Branch Vincent
d69a290c2f completions: add pre-commit 2023-02-05 12:12:47 +01:00
Wout De Puysseleir
43a7c20ddb completions/mix: Add mix phx
- Added phx completions. These are very common completions for the Elixir Phoenix Framework.
  Documentation can be found here: https://hexdocs.pm/phoenix/1.7.0-rc.2/Mix.Tasks.Local.Phx.html#content
- Added argument completions
- Made all descriptions start with an uppercase for better consistency
- Update CHANGELOG.rst
2023-02-05 12:10:31 +01:00
Mahmoud Al-Qudsi
538518cdf3 CI: Use the cmake-core package on FreeBSD
The `cmake` meta package pulls in `cmake-core`, `cmake-docs`, and `cmake-man` -
we don't need the latter two.

(It seems to be available on all the versions/architectures we target.)
2023-02-02 20:41:57 -06:00
Mahmoud Al-Qudsi
608f2bab31 CI: Use git-lite instead of git under FreeBSD
The git-lite flavor, being significantly smaller and downloading/installing much
faster with fewer dependencies, is much better suited for CI environments (at
the cost of not supporting interactive git commands).
2023-02-02 20:41:57 -06:00
Mahmoud Al-Qudsi
440dcb48c5 CI: Upgrade FreeBSD 13 to 13.1
By default /etc/pkg/FreeBSD.conf uses either the /quarterly or /latest pkg
builds, which are built against the latest minor release of FreeBSD for the
given ${ABI} string at the time they were last updated.

The nature of the shared binary packages means everyone (across all minor
versions of the same major version on the same architecture, all of which share
the same stable ABI) gets the same binary build.

There are however packages which depend on symbols exported by system-provided
libraries (rather than by other packages, which are always going to be in sync)
that *aren't* stable across minor releases, leaving packages like llvm
broken if you install the latest llvm from pkg's binary repos built against,
say, FreeBSD 13.1 while running FreeBSD 13.0.

The other option is to use the "snapshots" of the binary packages available upon
the release of each minor version, by using /release_0, /release_1, etc instead
of /quarterly or /latest, but then you're limited to the ports that were
available at that specific date and those old versions.

tl;dr just make sure we're always using the latest minor release for each major
version of FreeBSD we intend to support.
2023-02-02 20:41:57 -06:00
David Adam
fb3056d7a1 fish.spec: drop long-obsolete BuildRoot directive
Ignored since RPM 4.6.0, released in 2009!
2023-02-01 22:26:30 +08:00
LingMan
0af2a7a9b7 Upgrade GitHub action dessant/lock-threads to v4
In v3 several input parameters where renamed and since v4 it requires Node.js 16.

This resolves warnings about Node.js 12 and `set-output` being deprecated and
slated for removal in the `Lock threads` workflow.
2023-02-01 10:40:46 +08:00
Mahmoud Al-Qudsi
31f63b2f87 Upgrade GitHub CI actions/checkout to v3
This addresses the node v12 deprecation warning in the GitHub CI, caused by the
dependency on actions/checkout@v2.

While actions/checkout@v3 introduces some new features and changes some
defaults, the subset of features that we use should not be affected by this
migration.

The "breaking change" from v2 to v3 can be seen at [0]. Since we are tracking
only v2 without a dot release specified, we are already opting into any breakage
across minor versions, so really the only change of note is the node version
upgrade.

[0]: https://github.com/actions/checkout/compare/v2.4.2...v3.0.0
2023-01-31 11:50:57 -06:00
nat-418
cf67709931 feat: add support for fossil-scm in prompt (#9500)
* feat: add support for fossil-scm in prompt

* fix: change directory testing and string matching
2023-01-29 16:54:39 +01:00
Fabian Boehm
d239e26f6b docs: Add a missing newline
Sphinx is annoyingly specific here
2023-01-29 14:46:35 +01:00
Fabian Boehm
177ce0d40e __fish_make_completion_signals: Check for "kill" 2023-01-29 14:44:59 +01:00
Fabian Boehm
dd7d432cd6 Only define kill wrapper if we have a kill to wrap 2023-01-29 14:44:45 +01:00
David Adam
2a24295e50 debian packaging: add dependency on procps
See https://bugs.debian.org/1029940
2023-01-29 21:21:47 +08:00
Johannes Altmanninger
243ade838b completions/git: also complete filepaths as second argument to git grep
Fixes a regression in f81e8c7de (completions/git: complete refs for "git
grep", 2022-12-08).

Fixes #9513
2023-01-28 21:25:42 +01:00
Fabian Boehm
7f2cb47437 fish_key_reader: Don't translate things to "\v" and friends
This translated ctrl-k to "\v", which is a "vertical tab", and ctrl-l
to "\f" and ctrl-g to "\a".

There is no "vertical tab" or "alarm" or "\f" *key*, so these
shouldn't be translated. Just drop these and call them `\ck` and such.

(vertical tab specifically is utterly useless and I would be okay with
dropping it entirely, I have never seen it used anywhere)
2023-01-27 17:07:18 +01:00
Johannes Altmanninger
befa240756 completions/git: use builtin path for finding subcommands
This is more elegant and efficient. No functional change.

As suggested by 2da1a4ae7 (completions/git: Fix git-foo commands, 2023-01-09).
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
f033b4df7d completions/git: fix typo 2023-01-24 20:37:38 +01:00
Johannes Altmanninger
7c1c3f9f77 completions/git: do not use user input as format string
Suggested by f5711ad5e (git.fish: collapse repeat complete cmds, set -f,
rm unneeded funcs, 2022-10-27).
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
72e9d02650 Revert "git.fish: collapse repeat complete cmds, set -f, rm unneeded funcs"
That commit did way too many things, making it hard to see the 5 regressions
it introduced. Let's revert it and its stragglers. In future, we could redo
some of the changes.

Reverts changes to share/completions/git.fish from

- 3548aae55 (completions/git: Don't leak submodule subcommands, 2023-01-23)
- 905f788b3 (completions/git: Remove awkward newline symbol, 2023-01-10)
- 2da1a4ae7 (completions/git: Fix git-foo commands, 2023-01-09)
- e9bf8b9a4 (Run fish_indent on share/completions/*.fish, 2022-12-08)
- d31847b1d (Fix apparent dyslexia, 2022-11-12)
- 054d0ac0e (git completions: undo mistaken `set -f` usage, 2022-10-28)
- f5711ad5e (git.fish: collapse repeat complete cmds, set -f, rm unneeded funcs, 2022-10-27)
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
04cae2c559 completions/kak: show -debug arguments
Technically this is a |-separated list, we might need to teach __fish_append
to tokenize.
2023-01-24 20:37:38 +01:00
Johannes Altmanninger
29a3344226 Make bracketed paste add only one undo entry
Bracketed paste adds one undo entry unless the pasted text contains a '
or \.  This is because the "paste" bind-mode has bindings for those keys,
so they effectively start a new undo entry.

Let's fix this by adding an explicit undo group (our first use of this
feature!).
2023-01-24 20:32:13 +01:00
Fabian Boehm
21f1eebd01 completions/git: Some rewordings
These are the longest subcommand descriptions, so it gives us more space
2023-01-23 21:18:03 +01:00
Fabian Boehm
3548aae552 completions/git: Don't leak submodule subcommands
Introduced in f5711ad5ed through an unclean edit.
2023-01-23 21:17:53 +01:00
Fabian Boehm
bd871c5372 Fix last PCRE2_UCHAR32
See #9502
2023-01-23 20:03:29 +01:00
Johannes Altmanninger
d055726ed7 CHANGELOG: fuzzy matching in history-pager 2023-01-22 16:14:14 +01:00
Johannes Altmanninger
610d19cec1 CHANGELOG: don't mention the overly-specific terraform fix 2023-01-22 16:14:00 +01:00
Eddie Lebow
00692bcdfe Include subsequence matches in history-pager
If a `contains` search yields no results, try again with `contains_subsequence`.
2023-01-22 16:11:46 +01:00
112 changed files with 1046 additions and 704 deletions

View File

@@ -83,12 +83,12 @@ freebsd_task:
image_family: freebsd-14-0-snap
- name: FreeBSD 13
freebsd_instance:
image: freebsd-13-0-release-amd64
image: freebsd-13-1-release-amd64
- name: FreeBSD 12.3
freebsd_instance:
image: freebsd-12-3-release-amd64
tests_script:
- pkg install -y cmake devel/pcre2 devel/ninja misc/py-pexpect git
- pkg install -y cmake-core devel/pcre2 devel/ninja misc/py-pexpect git-lite
# BSDs have the following behavior: root may open or access files even if
# the mode bits would otherwise disallow it. For example root may open()
# a file with write privileges even if the file has mode 400. This breaks

View File

@@ -17,9 +17,9 @@ jobs:
pull-requests: write # for dessant/lock-threads to lock PRs
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v2
- uses: dessant/lock-threads@v4
with:
github-token: ${{ github.token }}
issue-lock-inactive-days: '365'
pr-lock-inactive-days: '365'
issue-exclude-labels: 'question, needs more info'
issue-inactive-days: '365'
pr-inactive-days: '365'
exclude-any-issue-labels: 'question, needs more info'

View File

@@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
@@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt update
@@ -66,7 +66,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
@@ -100,7 +100,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install deps
run: |
sudo apt install gettext libncurses5-dev libpcre2-dev python3-pip tmux
@@ -126,7 +126,7 @@ jobs:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install deps
run: |
sudo pip3 install pexpect

View File

@@ -1,39 +1,7 @@
fish 3.6.4 (released December 5, 2023)
======================================
fish 3.7.0 (released ???)
===================================
This release contains a complete fix for the test suite failure in fish 3.6.2 and 3.6.3.
--------------
fish 3.6.3 (released December 4, 2023)
======================================
This release contains a fix for a test suite failure in fish 3.6.2.
--------------
fish 3.6.2 (released December 4, 2023)
======================================
This release of fish contains a security fix for CVE-2023-49284, a minor security problem identified
in fish 3.6.1 and previous versions (thought to affect all released versions of fish).
fish uses certain Unicode non-characters internally for marking wildcards and expansions. It
incorrectly allowed these markers to be read on command substitution output, rather than
transforming them into a safe internal representation.
For example, ``echo \UFDD2HOME`` has the same output as ``echo $HOME``.
While this may cause unexpected behavior with direct input, this may become a minor security problem
if the output is being fed from an external program into a command substitution where this output
may not be expected.
--------------
fish 3.6.1 (released March 25, 2023)
====================================
This release of fish contains a number of fixes for problems identified in fish 3.6.1, as well as some enhancements.
.. ignore: 9439 9440 9442 9452 9469 9480 9482
Notable improvements and fixes
------------------------------
@@ -41,67 +9,63 @@ Notable improvements and fixes
abbr --erase (abbr --list)
can now be used to clean out all old abbreviations (:issue:`9468`).
- ``abbr --add --universal`` now warns about ``--universal`` being non-functional, to make it easier to detect old-style ``abbr`` calls (:issue:`9475`).
- ``abbr --add --universal`` now warns about --universal being non-functional, to make it easier to detect old-style ``abbr`` calls (:issue:`9475`).
- ``functions --handlers-type caller-exit`` once again lists functions defined as ``function --on-job-exit caller``, rather than them being listed by ``functions --handlers-type process-exit``.
Deprecations and removed features
---------------------------------
- The Web-based configuration for abbreviations has been removed, as it was not functional with the changes abbreviations introduced in 3.6.0 (:issue:`9460`).
Scripting improvements
----------------------
- ``abbr --list`` no longer escapes the abbr name, which is necessary to be able to pass it to ``abbr --erase`` (:issue:`9470`).
- ``read`` will now print an error if told to set a read-only variable, instead of silently doing nothing (:issue:`9346`).
- ``set_color -v`` no longer crashes fish (:issue:`9640`).
- ``read`` will now print an error if told to set a read-only variable instead of silently doing nothing (:issue:`9346`).
- ``functions`` and ``type`` now show where a function was copied and where it originally was instead of saying ``Defined interactively``.
- Stack trace now shows line numbers for copied functions.
Interactive improvements
------------------------
- Using ``fish_vi_key_bindings`` in combination with fish's ``--no-config`` mode works without locking up the shell (:issue:`9443`).
- The history pager now uses more screen space, usually half the screen (:issue:`9458`)
- Variables that were set while the locale was C (the default ASCII-only locale) will now properly be encoded if the locale is switched (:issue:`2613`, :issue:`9473`).
- Escape during history search restores the original command line again (fixing a regression in 3.6.0).
- Using ``--help`` on builtins now respects the ``$MANPAGER`` variable, in preference to ``$PAGER`` (:issue:`9488`).
- :kbd:`Control-G` closes the history pager, like other shells (:issue:`9484`).
- The documentation for the ``:``, ``[`` and ``.`` builtin commands can now be looked up with ``man`` (:issue:`9552`).
- fish no longer crashes when searching history for non-ASCII codepoints case-insensitively (:issue:`9628`).
- The :kbd:`Alt-S` binding will now also use ``please`` if available (:issue:`9635`).
- Themes that don't specify every color option can be installed correctly in the Web-based configuration (:issue:`9590`).
- Compatibility with Midnight Commander's prompt integration has been improved (:issue:`9540`).
- A spurious error, noted when using fish in Google Drive directories under WSL 2, has been silenced (:issue:`9550`).
- Using ``read`` in ``fish_greeting`` or similar functions will not trigger an infinite loop (:issue:`9564`).
- Compatibility when upgrading from old versions of fish (before 3.4.0) has been improved (:issue:`9569`).
- The history pager now uses more screen space, usually half the screen (:issue:`9458`).
- The history pager now shows fuzzy (subsequence) matches in the absence of exact substring matches (:issue:`9476`).
- Variables that were set while the locale was C (i.e. ASCII) will now properly be encoded if the locale is switched (:issue:`2613`, :issue:`9473`).
- Escape during history search restores the original commandline again (regressed in 3.6.0).
- Using ``--help`` on builtins now respects the $MANPAGER variable in preference to $PAGER (:issue:`9488`).
- Command-specific tab completions may now offer results whose first character is a period. For example, it is now possible to tab-complete ``git add`` for files with leading periods. The default file completions hide these files, unless the token itself has a leading period (:issue:`3707`).
New or improved bindings
^^^^^^^^^^^^^^^^^^^^^^^^
Improved prompts
^^^^^^^^^^^^^^^^
- The git prompt will compute the stash count to be used independently of the informative status (:issue:`9572`).
Completions
^^^^^^^^^^^
- Added completions for:
- ``apkanalyzer`` (:issue:`9558`)
- ``neovim`` (:issue:`9543`)
- ``otool``
- ``pre-commit`` (:issue:`9521`)
- ``proxychains`` (:issue:`9486`)
- ``scrypt`` (:issue:`9583`)
- ``stow`` (:issue:`9571`)
- ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore`` (:issue:`9560`)
- ``ssh-copy-id`` (:issue:`9675`)
- Improvements to many completions, including the speed of completing directories in WSL 2 (:issue:`9574`).
- Completions using ``__fish_complete_suffix`` are now offered in the correct order, fixing a regression in 3.6.0 (:issue:`8924`).
- ``git`` completions for ``git-foo``-style commands was restored, fixing a regression in 3.6.0 (:issue:`9457`).
- File completion now offers ``../`` and ``./`` again, fixing a regression in 3.6.0 (:issue:`9477`).
- The behaviour of completions using ``__fish_complete_path`` matches standard path completions (:issue:`9285`).
- ``mix phx``
- ``neovim``
- ``stow``
- ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore``
- ``apkanalyzer``
- git's completion for ``git-foo``-style commands was fixed (:issue:`9457`)
- File completion now offers ``../`` and ``./`` again (:issue:`9477`)
Improved terminal support
^^^^^^^^^^^^^^^^^^^^^^^^^
Other improvements
------------------
- Improvements and corrections to the documentation.
For distributors
----------------
- fish 3.6.1 builds correctly on Cygwin (:issue:`9502`).
- *Placeholder to fix Sphinx warning*
--------------
fish 3.6.0 (released January 7, 2023)
=====================================

View File

@@ -34,10 +34,10 @@ The following options are available:
Causes the specified functions to be erased. This also means that it is prevented from autoloading in the current session. Use :doc:`funcsave <funcsave>` to remove the saved copy.
**-D** or **--details**
Reports the path name where the specified function is defined or could be autoloaded, ``stdin`` if the function was defined interactively or on the command line or by reading standard input, **-** if the function was created via :doc:`source <source>`, and ``n/a`` if the function isn't available. (Functions created via :doc:`alias <alias>` will return **-**, because ``alias`` uses ``source`` internally.) If the **--verbose** option is also specified then five lines are written:
Reports the path name where the specified function is defined or could be autoloaded, ``stdin`` if the function was defined interactively or on the command line or by reading standard input, **-** if the function was created via :doc:`source <source>`, and ``n/a`` if the function isn't available. (Functions created via :doc:`alias <alias>` will return **-**, because ``alias`` uses ``source`` internally. Copied functions will return where the function was copied.) If the **--verbose** option is also specified then five lines are written:
- the pathname as already described,
- ``autoloaded``, ``not-autoloaded`` or ``n/a``,
- the path name as already described,
- if the function was copied, the path name to where the function was originally defined, otherwise ``autoloaded``, ``not-autoloaded`` or ``n/a``,
- the line number within the file or zero if not applicable,
- ``scope-shadowing`` if the function shadows the vars in the calling function (the normal case if it wasn't defined with **--no-scope-shadowing**), else ``no-scope-shadowing``, or ``n/a`` if the function isn't defined,
- the function description minimally escaped so it is a single line, or ``n/a`` if the function isn't defined or has no description.

View File

@@ -175,7 +175,7 @@ Remove _$smurf_ from the scope::
> set -e smurf
Remove _$smurf_ from the global and universal scopes::
Remove _$smurf_ from the global and universal scoeps::
> set -e -Ug smurf

View File

@@ -60,7 +60,8 @@ And here is fish::
> set foo "bar baz"
> printf '"%s"\n' $foo
# foo was set as one element, so it will be passed as one element, so this is one line
# foo was set as one element,
# so it will be passed as one element, so this is one line
"bar baz"
All variables are "arrays" (we use the term "lists"), and expanding a variable expands to all its elements, with each element as its own argument (like bash's ``"${var[@]}"``::

View File

@@ -107,11 +107,11 @@ If you want to share your script with others, you might want to use :command:`en
#!/usr/bin/env fish
echo Hello from fish $version
This will call ``env``, which then goes through :envvar:`PATH` to find a program called "fish". This makes it work, whether fish is installed in (for example) ``/usr/local/bin/fish``, ``/usr/bin/fish``, or ``~/.local/bin/fish``, as long as that directory is in :envvar:`PATH`.
This will call ``env``, which then goes through :envvar:`PATH` to find a program called "fish". This makes it work, whether fish is installed in /usr/local/bin/fish or /usr/bin/fish or ~/.local/bin/fish, as long as that directory is in :envvar:`PATH`.
The shebang line is only used when scripts are executed without specifying the interpreter. For functions inside fish or when executing a script with ``fish /path/to/script``, a shebang is not required (but it doesn't hurt!).
When executing files without an interpreter, fish, like other shells, tries your system shell, typically ``/bin/sh``. This is needed because some scripts are shipped without a shebang line.
When executing files without an interpreter, fish, like other shells, tries your system shell, typically /bin/sh. This is needed because some scripts are shipped without a shebang line.
Configuration
=============

View File

@@ -90,6 +90,7 @@ More examples::
searches for lines ending in ``enabled)`` in ``foo.txt`` (the ``$`` is special to ``grep``: it matches the end of the line).
::
apt install "postgres-*"
installs all packages with a name starting with "postgres-", instead of looking through the current directory for files named "postgres-something".
@@ -692,10 +693,29 @@ The ``$`` symbol can also be used multiple times, as a kind of "dereference" ope
# 20
# 30
``$$foo[$i]`` is "the value of the variable named by ``$foo[$i]``.
``$$foo[$i]`` is "the value of the variable named by ``$foo[$i]``".
When using this feature together with list brackets, the brackets will be used from the inside out. ``$$foo[5]`` will use the fifth element of ``$foo`` as a variable name, instead of giving the fifth element of all the variables $foo refers to. That would instead be expressed as ``$$foo[1..-1][5]`` (take all elements of ``$foo``, use them as variable names, then give the fifth element of those).
Some more examples::
set listone 1 2 3
set listtwo 4 5 6
set var listone listtwo
echo $$var
# Output is 1 2 3 4 5 6
echo $$var[1]
# Output is 1 2 3
echo $$var[2][3]
# $var[1] is listtwo, third element of that is 6, output is 6
echo $$var[..][2]
# The second element of every variable, so output is
# 2 5
.. _expand-command-substitution:
Command substitution
@@ -1079,12 +1099,13 @@ Here is an example of local vs function-scoped variables::
set gnu "In the beginning there was nothing, which exploded"
end
echo $pirate
# This will not output anything, since the pirate was local
echo $pirate
# This will output the good Captain's speech
# since $captain had function-scope.
echo $captain
# This will output the good Captain's speech since $captain had function-scope.
# This will output Sir Terry's wisdom.
echo $gnu
# Will output Sir Terry's wisdom.
end
When a function calls another, local variables aren't visible::
@@ -1121,7 +1142,8 @@ If you want to override a variable for a single command, you can use "var=val" s
Unlike other shells, fish will first set the variable and then perform other expansions on the line, so::
set foo banana
foo=gagaga echo $foo # prints gagaga, while in other shells it might print "banana"
foo=gagaga echo $foo
# prints gagaga, while in other shells it might print "banana"
Multiple elements can be given in a :ref:`brace expansion<expand-brace>`::
@@ -1298,10 +1320,14 @@ That covers the positional arguments, but commandline tools often get various op
A more robust approach to option handling is :doc:`argparse <cmds/argparse>`, which checks the defined options and puts them into various variables, leaving only the positional arguments in $argv. Here's a simple example::
function mybetterfunction
# We tell argparse about -h/--help and -s/--second - these are short and long forms of the same option.
# The "--" here is mandatory, it tells it from where to read the arguments.
# We tell argparse about -h/--help and -s/--second
# - these are short and long forms of the same option.
# The "--" here is mandatory,
# it tells it from where to read the arguments.
argparse h/help s/second -- $argv
# exit if argparse failed because it found an option it didn't recognize - it will print an error
# exit if argparse failed because
# it found an option it didn't recognize
# - it will print an error
or return
# If -h or --help is given, we print a little help text and return
@@ -1740,7 +1766,8 @@ Let's make up an example. This function will :ref:`glob <expand-wildcard>` the f
# If there are more than 5 files
if test (count $files) -gt 5
# and both stdin (for reading input) and stdout (for writing the prompt)
# and both stdin (for reading input)
# and stdout (for writing the prompt)
# are terminals
and isatty stdin
and isatty stdout

View File

@@ -28,8 +28,6 @@ BuildRequires: glibc-langpack-en
%endif
BuildRequires: python3 procps
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%if 0%{?rhel} && 0%{?rhel} < 8
Requires: python
%else

View File

@@ -2,7 +2,7 @@
function __fish_adb_no_subcommand -d 'Test if adb has yet to be given the subcommand'
for i in (commandline -opc)
if contains -- $i connect disconnect devices push pull sync shell emu logcat install uninstall jdwp forward bugreport backup restore version help start-server kill-server remount reboot get-state get-serialno get-devpath status-window root usb tcpip ppp sideload reconnect unroot exec-out
if contains -- $i connect disconnect devices push pull sync shell emu logcat install uninstall jdwp forward bugreport backup restore version help start-server kill-server remount reboot get-state get-serialno get-devpath status-window root usb tcpip ppp sideload reconnect
return 1
end
end
@@ -14,7 +14,7 @@ function __fish_adb_get_devices -d 'Run adb devices and parse output'
set -l procs (ps -Ao comm= | string match 'adb')
# Don't run adb devices unless the server is already started - it takes a while to init
if set -q procs[1]
adb devices -l | string replace -rf '(\S+).*product:(\S+).*model:(\S+).*' '$1'\t'$2 $3'
adb devices -l | string replace -rf '(\S+).*model:(\S+).*' '$1'\t'$2'
end
end
@@ -79,17 +79,6 @@ function __fish_adb_list_files
__fish_adb_run_command find -H "$token*" -maxdepth 0 -type f 2\>/dev/null
end
function __fish_adb_list_bin
# list all binary without group
__fish_adb_run_command ls -1 /system/bin/ 2\>/dev/null
__fish_adb_run_command ls -1 /system/xbin/ 2\>/dev/null
end
function __fish_adb_list_properties
__fish_adb_run_command getprop | string match -rg '\[(.*)\]:'
end
# Generic options, must come before command
complete -n __fish_adb_no_subcommand -c adb -o a -d 'Listen on all network interfaces'
complete -n __fish_adb_no_subcommand -c adb -o d -d 'Use first USB device'
@@ -129,13 +118,11 @@ complete -f -n __fish_adb_no_subcommand -c adb -a get-serialno -d 'Prints serial
complete -f -n __fish_adb_no_subcommand -c adb -a get-devpath -d 'Prints device path'
complete -f -n __fish_adb_no_subcommand -c adb -a status-window -d 'Continuously print the device status'
complete -f -n __fish_adb_no_subcommand -c adb -a root -d 'Restart the adbd daemon with root permissions'
complete -f -n __fish_adb_no_subcommand -c adb -a unroot -d 'Restart the adbd daemon without root permissions'
complete -f -n __fish_adb_no_subcommand -c adb -a usb -d 'Restart the adbd daemon listening on USB'
complete -f -n __fish_adb_no_subcommand -c adb -a tcpip -d 'Restart the adbd daemon listening on TCP'
complete -f -n __fish_adb_no_subcommand -c adb -a ppp -d 'Run PPP over USB'
complete -f -n __fish_adb_no_subcommand -c adb -a sideload -d 'Sideloads the given package'
complete -f -n __fish_adb_no_subcommand -c adb -a reconnect -d 'Kick current connection from host side and make it reconnect.'
complete -f -n __fish_adb_no_subcommand -c adb -a exec-out -d 'Execute a command on the device and send its stdout back'
# install options
complete -n '__fish_seen_subcommand_from install' -c adb -s l -d 'Forward-lock the app'
@@ -220,11 +207,3 @@ complete -n '__fish_seen_subcommand_from logcat' -c adb -s e -l regex -d 'Only p
complete -n '__fish_seen_subcommand_from logcat' -c adb -s m -l max-count -d 'Quit after print <count> lines'
complete -n '__fish_seen_subcommand_from logcat' -c adb -l print -d 'Print all message even if they do not matches, requires --regex and --max-count'
complete -n '__fish_seen_subcommand_from logcat' -c adb -l uid -d 'Only display log messages from UIDs present in the comma separate list <uids>'
# commands that accept listing device binaries
complete -n '__fish_seen_subcommand_from exec-out' -c adb -f -a "(__fish_adb_list_bin)" -d "Command on device"
complete -n '__fish_seen_subcommand_from shell' -c adb -f -a "(__fish_adb_list_bin)" -d "Command on device"
# setprop and getprop in shell
complete -n '__fish_seen_subcommand_from setprop' -c adb -f -a "(__fish_adb_list_properties)" -d 'Property to set'
complete -n '__fish_seen_subcommand_from getprop' -c adb -f -a "(__fish_adb_list_properties)" -d 'Property to get'

View File

@@ -1,6 +1,6 @@
# Completions for the `apt` command
# macOS has a /usr/bin/apt that is something else entirely:
# macOS has a /usr/bin/apt that is something else entirely:
# (apt - Returns the path to a Java home directory from the current user's settings)
if [ "$(uname -s)" = Darwin -a "$(command -s apt)" = /usr/bin/apt ]
exit 1
@@ -14,7 +14,7 @@ set -l handle_file_pkg_subcmds install
function __fish_apt_subcommand -V all_subcmds
set -l subcommand $argv[1]
set -e argv[1]
complete -f -c apt -n "not __fish_seen_subcommand_from $all_subcmds" -a $subcommand $argv
complete -f -c apt -n "__fish_is_first_token" -a $subcommand $argv
end
function __fish_apt_option
@@ -33,9 +33,10 @@ end
complete -c apt -f
complete -k -c apt -n "__fish_seen_subcommand_from $pkg_subcmds" -a '(__fish_print_apt_packages | string match -re -- "(?:\\b|_)"(commandline -ct | string escape --style=regex) | head -n 250 | sort)'
complete -c apt -n "__fish_seen_subcommand_from $installed_pkg_subcmds" -a '(__fish_print_apt_packages --installed | string match -re -- "(?:\\b|_)"(commandline -ct | string escape --style=regex) | head -n 250)'
complete -k -c apt -n "__fish_seen_subcommand_from $handle_file_pkg_subcmds" -a '(__fish_complete_suffix .deb)'
# We use -k to keep PWD directories (from the .deb completion) after packages, so we need to sort the packages
complete -k -c apt -n "__fish_seen_subcommand_from $handle_file_pkg_subcmds" -kxa '(__fish_complete_suffix .deb)'
complete -k -c apt -n "__fish_seen_subcommand_from $pkg_subcmds" -kxa '(__fish_print_apt_packages | sort)'
complete -c apt -n "__fish_seen_subcommand_from $installed_pkg_subcmds" -kxa '(__fish_print_apt_packages --installed | sort)'
complete -c apt -n "__fish_seen_subcommand_from install" -l no-install-recommends
# This advanced flag is the safest way to upgrade packages that otherwise would have been kept back

View File

@@ -1,4 +1,12 @@
complete -x -c asciidoctor -k -a "(__fish_complete_suffix .asciidoc .adoc .ad .asc .txt)"
complete -x -c asciidoctor -k -a "
(
__fish_complete_suffix .asciidoc
__fish_complete_suffix .adoc
__fish_complete_suffix .ad
__fish_complete_suffix .asc
__fish_complete_suffix .txt
)
"
# Security Settings
complete -c asciidoctor -s B -l base-dir -d "Base directory containing the document"

View File

@@ -2,7 +2,7 @@
complete -f -c at -s V -d "Display version and exit"
complete -f -c at -s q -d "Use specified queue"
complete -f -c at -s m -d "Send mail to user"
complete -c at -s f -k -x -a "(__fish_complete_suffix --description='At job' '')" -d "Read job from file"
complete -c at -s f -k -x -a "(__fish_complete_suffix (commandline -ct) '' 'At job')" -d "Read job from file"
complete -f -c at -s l -d "Alias for atq"
complete -f -c at -s d -d "Alias for atrm"
complete -f -c at -s v -d "Show the time"

View File

@@ -163,4 +163,6 @@ complete -c aura -n $sync -s y -l refresh -d 'Download fresh copy of the package
complete -c aura -n "$sync; and $argument" -xa "$listall $listgroups"
# Upgrade options
complete -c aura -n "$upgrade; and $argument" -k -xa '(__fish_complete_suffix pkg.tar.xz pkg.tar.gz pkg.tar.zst)' -d 'Package file'
complete -c aura -n "$upgrade; and $argument" -k -xa '(__fish_complete_suffix pkg.tar.xz)' -d 'Package file'
complete -c aura -n "$upgrade; and $argument" -k -xa '(__fish_complete_suffix pkg.tar.gz)' -d 'Package file'
complete -c aura -n "$upgrade; and $argument" -k -xa '(__fish_complete_suffix pkg.tar.zst)' -d 'Package file'

View File

@@ -1,4 +1,14 @@
complete -c bunzip2 -k -x -a "(__fish_complete_suffix .tbz .tbz2 .bz2 .bz)"
complete -c bunzip2 -k -x -a "(
__fish_complete_suffix .tbz
__fish_complete_suffix .tbz2
)
"
complete -c bunzip2 -k -x -a "(
__fish_complete_suffix .bz
__fish_complete_suffix .bz2
)
"
complete -c bunzip2 -s c -l stdout -d "Decompress to stdout"
complete -c bunzip2 -s f -l force -d Overwrite

View File

@@ -1,3 +1,13 @@
complete -c bzcat -k -x -a "(__fish_complete_suffix .tbz .tbz2 .bz .bz2)"
complete -c bzcat -k -x -a "(
__fish_complete_suffix .tbz
__fish_complete_suffix .tbz2
)
"
complete -c bzcat -k -x -a "(
__fish_complete_suffix .bz
__fish_complete_suffix .bz2
)
"
complete -c bzcat -s s -l small -d "Reduce memory usage"

View File

@@ -1,5 +1,15 @@
complete -c bzip2 -s c -l stdout -d "Compress to stdout"
complete -c bzip2 -s d -l decompress -k -x -a "(__fish_complete_suffix .tbz .tbz2 .bz .bz2)"
complete -c bzip2 -s d -l decompress -k -x -a "(
__fish_complete_suffix .tbz
__fish_complete_suffix .tbz2
)
"
complete -c bzip2 -s d -l decompress -k -x -a "(
__fish_complete_suffix .bz
__fish_complete_suffix .bz2
)
"
complete -c bzip2 -s z -l compress -d "Compress file"
complete -c bzip2 -s t -l test -d "Check integrity"

View File

@@ -1,2 +1,11 @@
complete -c bzip2recover -k -x -a "(__fish_complete_suffix .tbz .tbz2 .bz .bz2)"
complete -c bzip2recover -k -x -a "(
__fish_complete_suffix .tbz
__fish_complete_suffix .tbz2
)
"
complete -c bzip2recover -k -x -a "(
__fish_complete_suffix .bz
__fish_complete_suffix .bz2
)
"

View File

@@ -49,6 +49,7 @@ complete -c cargo -n '__fish_seen_subcommand_from add install' -n '__fish_is_nth
## --- AUTO-GENERATED WITH `cargo complete fish` ---
# Manually massaged to improve some descriptions
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)'
@@ -76,7 +77,7 @@ complete -c cargo -n __fish_use_subcommand -f -a install -d 'Install a Rust bina
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 metadata -d 'Output the resolved dependencies of a package 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'
@@ -166,7 +167,7 @@ complete -c cargo -n "__fish_seen_subcommand_from build" -l no-default-features
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" -l future-incompat-report -d 'Output a future incompatibility report after 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)'
@@ -203,7 +204,7 @@ complete -c cargo -n "__fish_seen_subcommand_from check" -l all-features -d 'Act
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" -l future-incompat-report -d 'Output a future incompatibility report after 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)'
@@ -342,7 +343,7 @@ complete -c cargo -n "__fish_seen_subcommand_from git-checkout" -l frozen -d 'Re
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 vcs -d 'Initialize a new repository for the given version control system' -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'
@@ -444,7 +445,7 @@ complete -c cargo -n "__fish_seen_subcommand_from metadata" -l frozen -d 'Requir
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 vcs -d 'Initialize a new repository for the given version control system' -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'
@@ -695,8 +696,8 @@ complete -c cargo -n "__fish_seen_subcommand_from tree" -l manifest-path -d 'Pat
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" -l target -d 'Filter dependencies matching the given target-triple (or `all` for all targets)'
complete -c cargo -n "__fish_seen_subcommand_from tree" -s e -l edges -d 'The kinds of dependencies to display' -xa "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"

View File

@@ -6,7 +6,10 @@ set -l __fish_castnow_keys "space\tToggle\ between\ play\ and\ pause m\tToggle\
complete -c castnow -l tomp4 -d "Convert file to mp4 during playback"
complete -c castnow -l device -d "Specify name of Chromecast device to be used" -x
complete -c castnow -l address -d "Specify IP or hostname of Chromecast device" -x
complete -c castnow -l subtitles -d "Path or URL to SRT or VTT file" -k -x -a "(__fish_complete_suffix .srt .vtt)"
complete -c castnow -l subtitles -d "Path or URL to SRT or VTT file" -k -x -a "(
__fish_complete_suffix .srt
__fish_complete_suffix .vtt
)"
complete -c castnow -l subtitles-scale -d "Set subtitles font scale" -x
complete -c castnow -l subtitles-color -d "Set subtitles font RGBA color" -x
complete -c castnow -l subtitles-port -d "Specify port to be used for serving subtitles" -x

View File

@@ -4,4 +4,4 @@
complete -p '*clang++*' -n __fish_should_complete_switches -xa '(__fish_complete_clang)'
complete -p '*clang++*' -n 'not __fish_should_complete_switches' \
-k -xa "(__fish_complete_suffix .o .out .c .cpp .so .dylib)"
-k -xa "(__fish_complete_suffix .o; __fish_complete_suffix .out; __fish_complete_suffix .c; __fish_complete_suffix .cpp; __fish_complete_suffix .so; __fish_complete_suffix .dylib)"

View File

@@ -5,8 +5,8 @@
# This pattern unfortunately matches clang-format, etc. as well.
complete -p '*clang*' -n __fish_should_complete_switches -xa '(__fish_complete_clang)'
complete -c clang -n 'not __fish_should_complete_switches' \
-k -xa "(__fish_complete_suffix .o .out .c .cpp .so .dylib)"
-k -xa "(__fish_complete_suffix .o; __fish_complete_suffix .out; __fish_complete_suffix .c; __fish_complete_suffix .cpp; __fish_complete_suffix .so; __fish_complete_suffix .dylib)"
# again but without the -x this time for the pattern-matched completion
complete -p '*clang*' -n 'not __fish_should_complete_switches' \
-k -a "(__fish_complete_suffix .o .out .c .cpp .so .dylib)"
-k -a "(__fish_complete_suffix .o; __fish_complete_suffix .out; __fish_complete_suffix .c; __fish_complete_suffix .cpp; __fish_complete_suffix .so; __fish_complete_suffix .dylib)"

View File

@@ -1,4 +1,9 @@
complete -k -x -c cmark -a "(__fish_complete_suffix .md .markdown)"
complete -k -x -c cmark -a "
(
__fish_complete_suffix .md
__fish_complete_suffix .markdown
)
"
complete -x -c cmark -s t -l to -a "html man xml latex commonmark" -d "Output format"
complete -c cmark -l width -d "Wrap width"

View File

@@ -1,4 +1,4 @@
complete -c curl -n 'string match -qr "^@" -- (commandline -ct)' -k -xa "(printf '%s\n' -- @(__fish_complete_suffix --complete=(commandline -ct | string replace -r '^@' '') ''))"
complete -c curl -n 'string match -qr "^@" -- (commandline -ct)' -k -xa "(printf '%s\n' -- @(__fish_complete_suffix (commandline -ct | string replace -r '^@' '') ''))"
# These based on the autogenerated completions.
complete -c curl -l abstract-unix-socket -d '(HTTP) Connect through an abstract Unix domain socket'

View File

@@ -49,11 +49,10 @@ complete -c dart -n '__fish_seen_subcommand_from format' -s l -l line-length -d
complete -c dart -n '__fish_seen_subcommand_from migrate' -l apply-changes -d 'Apply the proposed null safety changes to the files on disk.'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l ignore-errors -d 'Attempt to perform null safety analysis even if the project has analysis errors.'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l skip-import-check -d 'Go ahead with migration even if some imported files have not yet been migrated.'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l web-preview -d 'Show an interactive preview of the proposed null safety changes in a browser window. Use --no-web-preview to print proposed changes to the console. (defaults to on)'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l no-web-preview -d 'Show an interactive preview of the proposed null safety changes in a browser window. Use --no-web-preview to print proposed changes to the console. (defaults to on)'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-hostname -d 'Run the preview server on the specified hostname. If not specified, "localhost" is used. Use "any" to specify IPv6.any or IPv4.any.(defaults to "localhost")'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-port -d 'Run the preview server on the specified port. If not specified, dynamically allocate a port.'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-port -d 'Output a machine-readable summary of migration changes.'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l web-preview -d 'Show preview of the proposed null safety changes in a browser window'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l no-web-preview -d 'Show preview of the proposed null safety changes in the console'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-hostname -d 'Run the preview server on the specified hostname'
complete -c dart -n '__fish_seen_subcommand_from migrate' -l preview-port -d 'Run the preview server on the specified port'
# pub
complete -c dart -n '__fish_seen_subcommand_from pub' -s C -l directory -d 'Run the subcommand in the directory<dir>.(defaults to ".")'
@@ -73,7 +72,7 @@ complete -c dart -n '__fish_seen_subcommand_from pub' -xa ploader -d 'Manage upl
# run
complete -c dart -n '__fish_seen_subcommand_from run' -l observe -d 'The observe flag is a convenience flag used to run a program with a set of common options useful for debugging.'
complete -c dart -n '__fish_seen_subcommand_from run' -l enable-vm-service -d 'Enables the VM service and listens on the specified port for connections (default port number is 8181, default bind address is localhost).'
complete -c dart -n '__fish_seen_subcommand_from run' -l enable-vm-service -d 'Enables VM service and listen on the specified port (default localhost:8181)'
complete -c dart -n '__fish_seen_subcommand_from run' -l serve-devtools -d 'Serves an instance of the Dart DevTools debugger and profiler via the VM service at <vm-service-uri>/devtools.'
complete -c dart -n '__fish_seen_subcommand_from run' -l no-serve-devtools -d 'Serves an instance of the Dart DevTools debugger and profiler via the VM service at <vm-service-uri>/devtools.'
complete -c dart -n '__fish_seen_subcommand_from run' -l pause-isolates-on-exit -d 'Pause isolates on exit when running with --enable-vm-service.'

View File

@@ -1,19 +1 @@
deno completions fish | source
# complete deno task
set searchForDenoFilesCode '
// order matters
const denoFile = ["deno.json", "deno.jsonc", "package.json"];
for (const file of denoFile) {
try {
Deno.statSync(file);
// file exists
const props = file === "package.json" ? "scripts" : "tasks";
console.log(
Object.keys(JSON.parse(Deno.readTextFileSync(file))[props]).join("\n"),
);
break;
} catch {}
}
'
complete -f -c deno -n "__fish_seen_subcommand_from task" -n "__fish_is_nth_token 2" -a "(deno eval '$searchForDenoFilesCode')"

View File

@@ -8,7 +8,7 @@ complete -x -f -c dpkg-reconfigure -s h -l help -d 'Display help'
# General options
complete -f -c dpkg-reconfigure -s f -l frontend -r -a "dialog readline noninteractive gnome kde editor web" -d 'Set configuration frontend'
complete -f -c dpkg-reconfigure -s p -l priority -r -a "low medium high critical" -d 'Set priority threshold'
complete -f -c dpkg-reconfigure -l default-priority -d "Use current default ("(echo get debconf/priority | debconf-communicate 2>/dev/null | string match -r '\w+$')") priority threshold"
complete -f -c dpkg-reconfigure -l default-priority -d "Use current default priority threshold"
complete -f -c dpkg-reconfigure -s u -l unseen-only -d 'Show only unseen question'
complete -f -c dpkg-reconfigure -l force -d 'Reconfigure also inconsistent packages'
complete -f -c dpkg-reconfigure -l no-reload -d 'Prevent reloading templates'

View File

@@ -1,15 +1,19 @@
set -l commands flashall getvar oem flashing reboot update erase format devices flash get_staged help stage boot fetch
function __fish_fastboot_list_partition_or_file
if __fish_seen_subcommand_from (__fish_fastboot_list_partition){_a,_b,}
__fish_complete_path
else
__fish_fastboot_list_partition
set -l tokens (commandline -opc)
# if last 2 token is flash, then list file
if test (count $tokens) -gt 2
if test $tokens[-2] = flash
__fish_complete_path
return
end
end
__fish_fastboot_list_partition
end
function __fish_fastboot_list_partition
set -l partitions boot bootloader dtbo modem odm odm_dlkm oem product pvmfw radio recovery system vbmeta vendor vendor_dlkm cache userdata system_ext
set -l partitions boot bootloader cache cust dtbo metadata misc modem odm odm_dlkm oem product pvmfw radio recovery system system_ext userdata vbmeta vendor vendor_dlkm vmbeta_system
for i in $partitions
echo $i
end
@@ -73,4 +77,3 @@ complete -n '__fish_seen_subcommand_from reboot' -c fastboot -xa 'bootloader fas
# oem
complete -n '__fish_seen_subcommand_from oem' -c fastboot -xa 'device-info lock unlock edl'

View File

@@ -28,7 +28,7 @@ end
complete -c gcc -s o -d 'Place output in file' -r
complete -c gcc -o aux-info -d 'Output to given file prototyped declarations for all functions from a translation unit' -r
complete -c gcc -o fabi-version -d 'Use specified version of the C++ ABI' -xa "0 1"
complete -c gcc -l sysroot -x -a '(__fish_complete_directories)' -d 'Use dir as the logical root directory for headers and libraries'
complete -c gcc -l sysroot -x -a '(__fish_complete_directories)' -d 'Use dir as the root directory for headers and libraries'
#
@@ -39,8 +39,8 @@ complete -c gcc -o pass-exit-codes -d 'Return the highest error returned by any
complete -c gcc -s c -d 'Compile or assemble the source files, but do not link'
complete -c gcc -s S -d 'Do not assemble'
complete -c gcc -s E -d 'Stop after preprocessing'
complete -c gcc -s v -d 'Print to stderr the commands executed to run compilation'
complete -c gcc -o \#\#\# -d 'Like -v except commands are not executed and all command arguments are quoted'
complete -c gcc -s v -d 'Print the executed commands to stderr'
complete -c gcc -o \#\#\# -d 'Like -v except commands are not executed'
complete -c gcc -o pipe -d 'Use pipes not temp files for communication'
complete -c gcc -o combine -d 'Pass all the source files to the compiler at once'
complete -c gcc -l help -d 'Print help'
@@ -64,28 +64,28 @@ complete -c gcc -o funsigned-bitfields -d 'Treat bitfields as unsigned by defaul
complete -c gcc -o fno-signed-bitfields -d 'Remove fsigned-bitfields'
complete -c gcc -o fno-unsigned-bitfields -d 'Remove funsinged-bitfields'
complete -c gcc -o fno-access-control -d 'Turn off all access checking'
complete -c gcc -o fcheck-new -d 'Check pointer returned by "operator new" is non-null before attempting to modify allocated storage'
complete -c gcc -o fconserve-space -d 'Put uninitialized or runtime-initialized global variables into the common segment, as C does'
complete -c gcc -o fcheck-new -d 'Check "operator new" returns non-null before modifying allocated storage'
complete -c gcc -o fconserve-space -d 'Put uninitialized global variables into the common segment, as C does'
complete -c gcc -o ffriend-injection -d 'Inject friend functions into enclosing namespace'
complete -c gcc -o fno-const-strings -d 'Give string constants type "char *" without const'
complete -c gcc -o fno-elide-constructors -d "Don't elide temporaries used to construct objects"
complete -c gcc -o fno-enforce-eh-specs -d 'Dont generate code to check for violation of exception specifications at runtime'
complete -c gcc -o ffor-scope -d 'Limit scope of variables declared in a for-init-statement to the for loop itself, as specified by the C++ standard'
complete -c gcc -o ffor-scope -d 'Limit scope of variables in for-init-statement to the loop itself, like the C++ standard says'
complete -c gcc -o fno-for-scope -d "Don't limit scope of vars declared in for loop to the for loop"
complete -c gcc -o fno-gnu-keywords -d 'Do not recognize "typeof" as a keyword, so code can use it as an identifier'
complete -c gcc -o fno-implicit-templates -d 'Never emit code for non-inline templates which are instantiated implicitly'
complete -c gcc -o fno-implicit-inline-templates -d 'Dont emit code for implicit instantiations of inline templates, either'
complete -c gcc -o fno-implement-inlines -d 'Do not emit out-of-line copies of inline functions controlled by #pragma implementation'
complete -c gcc -o fms-extensions -d 'Disable pedantic warnings about constructs used in MFC'
complete -c gcc -o fno-nonansi-builtins -d 'Disable built-in declarations of functions that are not mandated by ANSI/ISO C'
complete -c gcc -o fno-operator-names -d 'Do not treat the operator name keywords "and", "bitand", "bitor", "compl", "not", "or" and "xor" as synonyms as keywords'
complete -c gcc -o fno-nonansi-builtins -d 'Disable built-ins that are not mandated by ANSI/ISO C'
complete -c gcc -o fno-operator-names -d 'Do not treat and/bitand/bitor/compl/not/or/xor as keywords'
complete -c gcc -o fno-optional-diags -d 'Disable diagnostics that the standard says a compiler does not need to issue'
complete -c gcc -o fpermissive -d 'Downgrade some diagnostics about nonconformant code from errors to warnings'
complete -c gcc -o frepo -d 'Enable automatic template instantiation at link time'
complete -c gcc -o fno-rtti -d 'Disable generation of information about classes with virtual functions for use by dynamic_cast and typeid'
complete -c gcc -o fstats -d 'Emit statistics about front-end processing at the end of the compilation'
complete -c gcc -o fno-threadsafe-statics -d 'Do not emit the extra code to use the routines specified in the C++ ABI for thread-safe initialization of local statics'
complete -c gcc -o fuse-cxa-atexit -d 'Register destructors for objects with static storage duration with the "__cxa_atexit" function rather than the "atexit" function'
complete -c gcc -o fno-threadsafe-statics -d 'Do not emit code to use the routines specified in the C++ ABI for thread-safe initialization of local statics'
complete -c gcc -o fuse-cxa-atexit -d 'Use "__cxa_atexit" function for static object destructors'
complete -c gcc -o fvisibility-inlines-hidden -d 'Mark inlined methods with "__attribute__ ((visibility ("hidden")))"'
complete -c gcc -o fno-weak -d 'Do not use weak symbol support'
complete -c gcc -o nostdinc++ -d 'Do not search for header files in the standard directories specific to C++'
@@ -107,26 +107,25 @@ complete -c gcc -o name -d 'Use class-name as the name of the class to instantia
complete -c gcc -o fgnu-runtime -d 'Generate object code compatible with the standard GNU Objective-C runtime'
complete -c gcc -o fnext-runtime -d 'Generate output compatible with the NeXT runtime'
complete -c gcc -o fno-nil-receivers -d 'Assume that all Objective-C message dispatches (e'
complete -c gcc -o fobjc-call-cxx-cdtors -d 'For each Objective-C class, check if any of its instance variables is a C++ object with a non-trivial default constructor'
complete -c gcc -o fobjc-call-cxx-cdtors -d '(Obj-C), check if instance variables are a C++ object with non-trivial default constructor'
complete -c gcc -o fobjc-direct-dispatch -d 'Allow fast jumps to the message dispatcher'
complete -c gcc -o fobjc-exceptions -d 'Enable syntactic support for structured exception handling in Objective-C, similar to what is offered by C++ and Java'
complete -c gcc -o fobjc-exceptions -d '(Obj-C) Enable syntactic support for structured exception handling'
complete -c gcc -o fobjc-gc -d 'Enable garbage collection (GC) in Objective-C and Objective-C++ programs'
complete -c gcc -o freplace-objc-classes -d 'Emit a special marker instructing ld(1) not to statically link in the resulting object file, and allow dyld(1) to load it in at run time instead'
complete -c gcc -o fzero-link -d 'When compiling for the NeXT runtime, the compiler ordinarily replaces calls to "objc_getClass("'
complete -c gcc -o freplace-objc-classes -d 'Tell ld(1) not to statically link the object file, and allow dyld(1) to load it at run time instead'
complete -c gcc -o fzero-link
complete -c gcc -o gen-decls -d 'Dump interface declarations for all classes seen in the source file to a file named sourcename'
complete -c gcc -o Wassign-intercept -d 'Warn whenever an Objective-C assignment is being intercepted by the garbage collector'
complete -c gcc -o Wno-protocol -d 'If a class is declared to implement a protocol, a warning is issued for every method in the protocol that is not implemented by the class'
complete -c gcc -o Wno-protocol -d 'Warn about unimplemented protocol methods'
complete -c gcc -o Wselector -d 'Warn if multiple methods of different types for the same selector are found during compilation'
complete -c gcc -o Wstrict-selector-match -d 'Warn if multiple methods with differing argument and/or return types are found for a given selector when attempting to send a message using this selector to a receiver of type "id" or "Class"'
complete -c gcc -o Wundeclared-selector -d 'Warn if a "@selector('
complete -c gcc -o print-objc-runtime-info -d 'Generate C header describing the largest structure that is passed by value, if any'
complete -c gcc -o fmessage-length -d 'Try to format error messages so that they fit on lines of the specified number of characters' -x -a 80
complete -c gcc -o Wstrict-selector-match -d 'Warn if methods with differing argument/return types are found for a selector with a receiver of type "id"/"Class"'
complete -c gcc -o Wundeclared-selector -d 'Warn for a "@selector" referring to undeclared selector'
complete -c gcc -o print-objc-runtime-info -d 'Generate C header describing the largest structure that is passed by value'
complete -c gcc -o fmessage-length -d 'Try to format error messages so that they fit on lines of this number of characters' -x -a 80
complete -c gcc -o fdiagnostics-show-location -d 'Only meaningful in line-wrapping mode' -a once
complete -c gcc -o line -d 'Only meaningful in line-wrapping mode'
complete -c gcc -o fdiagnostics-show-options -d 'This option instructs the diagnostic machinery to add text to each diagnostic emitted, which indicates which command line option directly controls that diagnostic, when such an option is known to the diagnostic machinery'
complete -c gcc -o Wno- -d 'to turn off warnings; for example, -Wno-implicit'
complete -c gcc -o fdiagnostics-show-options -d 'Show which option controls a diagnostic'
complete -c gcc -o fsyntax-only -d 'Check the code for syntax errors, but dont do anything beyond that'
complete -c gcc -o pedantic -d 'Issue all the warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions'
complete -c gcc -o pedantic -d 'Issue all warnings demanded by strict ISO C and ISO C++; reject all programs that use forbidden extensions'
complete -c gcc -o pedantic-errors -d 'Like -pedantic, except that errors are produced rather than warnings'
complete -c gcc -s w -d 'Inhibit all warning messages'
complete -c gcc -o Wno-import -d 'Inhibit warning messages about the use of #import'
@@ -134,9 +133,9 @@ complete -c gcc -o Wchar-subscripts -d 'Warn if an array subscript has type "cha
complete -c gcc -o Wcomment -d 'Warn whenever a comment-start sequence appears in a comment'
complete -c gcc -o Wfatal-errors -d 'Abort compilation on the first error'
complete -c gcc -o Wformat -d 'Check calls to "printf" and "scanf", etc'
complete -c gcc -o Wformat-y2k -d 'With -Wformat, also warn about "strftime" formats which may yield only a two-digit year'
complete -c gcc -o Wno-format-extra-args -d 'With -Wformat, do not warn about excess arguments to "printf" or "scanf"'
complete -c gcc -o Wno-format-zero-length -d 'With -Wformat, do not warn about zero-length formats'
complete -c gcc -o Wformat-y2k -d 'Warn about "strftime" formats which may yield only a two-digit year'
complete -c gcc -o Wno-format-extra-args -d 'Do not warn about excess arguments to "printf" or "scanf"'
complete -c gcc -o Wno-format-zero-length -d 'Do not warn about zero-length formats'
complete -c gcc -o Wformat-nonliteral -d 'With -Wformat, also warn if the format string is not a string literal'
complete -c gcc -o Wformat-security -d 'With -Wformat, also warn about uses of potentially insecure format functions'
complete -c gcc -o Wnonnull -d 'Warn about passing a null pointer for arguments marked as requiring non-null'
@@ -147,13 +146,13 @@ complete -c gcc -o Werror-implicit-function-declaration -d 'Give a warning (or e
complete -c gcc -o Wimplicit -d 'Same as -Wimplicit-int and -Wimplicit-function-declaration'
complete -c gcc -o Wmain -d 'Warn if the type of main is suspicious'
complete -c gcc -o Wmissing-braces -d 'Warn if an aggregate or union initializer is not fully bracketed'
complete -c gcc -o Wmissing-include-dirs -d '(C, C++, Objective-C and Objective-C++ only) Warn if a user-supplied include directory does not exist'
complete -c gcc -o Wmissing-include-dirs -d '(C, C++, Obj-C, Obj-C++) Warn if a user-supplied include directory does not exist'
complete -c gcc -o Wparentheses -d 'Warn if parentheses are omitted where confusing'
complete -c gcc -o Wsequence-point -d 'Warn about undefined semantics because of violations of sequence point rules in the C standard'
complete -c gcc -o Wreturn-type -d 'Warn whenever a function is defined with a return-type that defaults to "int"'
complete -c gcc -o Wswitch -o Wswitch-enum -d 'Warn whenever a "switch" statement lacks a "case" for a member of an enum'
complete -c gcc -o Wswitch-default -d 'Warn whenever a "switch" statement does not have a "default" case'
complete -c gcc -o Wtrigraphs -d 'Warn if any trigraphs are encountered that might change the meaning of the program (trigraphs within comments are not warned about)'
complete -c gcc -o Wtrigraphs -d 'Warn about used trigraphs'
complete -c gcc -o Wunused-function -d 'Warn about unused functions'
complete -c gcc -o Wunused-label -d 'Warn about unused labels'
complete -c gcc -o Wunused-parameter -d 'Warn about unused function parameters'
@@ -175,14 +174,14 @@ complete -c gcc -o Wundef -d 'Warn if an undefined identifier is evaluated in an
complete -c gcc -o Wno-endif-labels -d 'Do not warn whenever an #else or an #endif are followed by text'
complete -c gcc -o Wshadow -d 'Warn if a local variable shadows another variable or if a built-in function is shadowed'
complete -c gcc -o Wlarger-than-len -d 'Warn whenever an object of larger than len bytes is defined'
complete -c gcc -o Wunsafe-loop-optimizations -d 'Warn if the loop cannot be optimized because the compiler could not assume anything on the bounds of the loop indices'
complete -c gcc -o Wunsafe-loop-optimizations -d 'Warn if a loop cannot be safely optimized'
complete -c gcc -o Wpointer-arith -d 'Warn about anything that depends on the "size of" a function type or of "void"'
complete -c gcc -o Wbad-function-cast -d '(C only) Warn whenever a function call is cast to a non-matching type'
complete -c gcc -o Wc++-compat -d 'Warn about ISO C constructs that are outside of the common subset of ISO C and ISO C++, e'
complete -c gcc -o Wcast-qual -d 'Warn whenever a pointer is cast so as to remove a type qualifier from the target type'
complete -c gcc -o Wcast-align -d 'Warn whenever a pointer is cast such that the required alignment of the target is increased'
complete -c gcc -o Wwrite-strings -d 'When compiling C, give string constants the type "const char[length]" so that copying the address of one into a non-"const" "char *" pointer will get a warning; when compiling C++, warn about the deprecated conversion from string constants to "char *"'
complete -c gcc -o Wconversion -d 'Warn if a prototype causes a type conversion that is different from what would happen to the same argument in the absence of a prototype'
complete -c gcc -o Wwrite-strings -d 'For C, give string constants the type "const char[length]"; For C++, warn about conversion from string constants to "char *"'
complete -c gcc -o Wconversion -d 'Warn if presence of a prototype changes type conversion'
complete -c gcc -o Wsign-compare -d 'Warn when a comparison between signed and unsigned values could produce an incorrect result when the signed value is converted to unsigned'
complete -c gcc -o Waggregate-return -d 'Warn if any functions that return structures or unions are defined or called'
complete -c gcc -o Wno-attributes -d 'Do not warn if an unexpected "__attribute__" is used, such as unrecognized attributes, function attributes applied to variables, etc'
@@ -195,10 +194,10 @@ complete -c gcc -o Wmissing-noreturn -d 'Warn about functions which might be can
complete -c gcc -o Wmissing-format-attribute -d 'Warn about function pointers which might be candidates for "format" attributes'
complete -c gcc -o Wno-multichar -d 'Do not warn if a multicharacter constant (FOOF) is used'
complete -c gcc -o Wnormalized -d 'In ISO C and ISO C++, two identifiers are different if they are different sequences of characters' -x -a "none id nfc nfkc"
complete -c gcc -o Wno-deprecated-declarations -d 'Do not warn about uses of functions, variables, and types marked as deprecated by using the "deprecated" attribute'
complete -c gcc -o Wpacked -d 'Warn if a structure is given the packed attribute, but the packed attribute has no effect on the layout or size of the structure'
complete -c gcc -o Wpadded -d 'Warn if padding is included in a structure, either to align an element of the structure or to align the whole structure'
complete -c gcc -o Wredundant-decls -d 'Warn if anything is declared more than once in the same scope, even in cases where multiple declaration is valid and changes nothing'
complete -c gcc -o Wno-deprecated-declarations -d 'Do not warn about uses of functions, variables, and types marked as deprecated'
complete -c gcc -o Wpacked -d 'Warn if a structure is given the packed attribute without effect'
complete -c gcc -o Wpadded -d 'Warn if padding is included in a structure'
complete -c gcc -o Wredundant-decls -d 'Warn if anything is declared more than once in the same scope'
complete -c gcc -o Wnested-externs -d '(C only) Warn if an "extern" declaration is encountered within a function'
complete -c gcc -o Wunreachable-code -d 'Warn if the compiler detects that code will never be executed'
complete -c gcc -o Winline -d 'Warn if a function can not be inlined and it was declared as inline'
@@ -207,7 +206,7 @@ complete -c gcc -o Wno-int-to-pointer-cast -d '(C only) Suppress warnings from c
complete -c gcc -o Wno-pointer-to-int-cast -d '(C only) Suppress warnings from casts from a pointer to an integer type of a different size'
complete -c gcc -o Winvalid-pch -d 'Warn if a precompiled header is found in the search path but cant be used'
complete -c gcc -o Wlong-long -d 'Warn if long long type is used'
complete -c gcc -o Wvariadic-macros -d 'Warn if variadic macros are used in pedantic ISO C90 mode, or the GNU alternate syntax when in pedantic ISO C99 mode'
complete -c gcc -o Wvariadic-macros -d 'Warn if variadic macros are used in pedantic mode'
complete -c gcc -o Wvolatile-register-var -d 'Warn if a register variable is declared volatile'
complete -c gcc -o Wdisabled-optimization -d 'Warn if a requested optimization pass is disabled'
complete -c gcc -o Wpointer-sign -d 'Warn for pointer argument passing or assignment with different signedness'
@@ -216,20 +215,20 @@ complete -c gcc -o Wstack-protector -d 'This option is only active when -fstack-
complete -c gcc -s g -d 'Produce debugging information in the operating systems native format (stabs, COFF, XCOFF, or DWARF 2)'
complete -c gcc -o ggdb -d 'Produce debugging information for use by GDB'
complete -c gcc -o gstabs -d 'Produce debugging information in stabs format (if that is supported), without GDB extensions'
complete -c gcc -o feliminate-unused-debug-symbols -d 'Produce debugging information in stabs format (if that is supported), for only symbols that are actually used'
complete -c gcc -o gstabs+ -d 'Produce debugging information in stabs format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB)'
complete -c gcc -o gcoff -d 'Produce debugging information in COFF format (if that is supported)'
complete -c gcc -o gxcoff -d 'Produce debugging information in XCOFF format (if that is supported)'
complete -c gcc -o gxcoff+ -d 'Produce debugging information in XCOFF format (if that is supported), using GNU extensions understood only by the GNU debugger (GDB)'
complete -c gcc -o gdwarf-2 -d 'Produce debugging information in DWARF version 2 format (if that is supported)'
complete -c gcc -o gvms -d 'Produce debugging information in VMS debug format (if that is supported)'
complete -c gcc -o glevel -d 'Request debugging information and also use level to specify how much information'
complete -c gcc -o ggdblevel -d 'Request debugging information and also use level to specify how much information'
complete -c gcc -o gstabslevel -d 'Request debugging information and also use level to specify how much information'
complete -c gcc -o gcofflevel -d 'Request debugging information and also use level to specify how much information'
complete -c gcc -o gxcofflevel -d 'Request debugging information and also use level to specify how much information'
complete -c gcc -o gvmslevel -d 'Request debugging information and also use level to specify how much information'
complete -c gcc -o feliminate-dwarf2-dups -d 'Compress DWARF2 debugging information by eliminating duplicated information about each symbol'
complete -c gcc -o feliminate-unused-debug-symbols -d 'Produce debugging information in stabs format, for only symbols that are actually used'
complete -c gcc -o gstabs+ -d 'Produce debug info in stabs format, using GNU extensions for GDB'
complete -c gcc -o gcoff -d 'Produce debug info in COFF format'
complete -c gcc -o gxcoff -d 'Produce debug info in XCOFF format'
complete -c gcc -o gxcoff+ -d 'Produce debug info in XCOFF format, using GNU extensions for GDB'
complete -c gcc -o gdwarf-2 -d 'Produce debug info in DWARF version 2 format'
complete -c gcc -o gvms -d 'Produce debug info in VMS debug format'
complete -c gcc -o glevel -d 'Request debug info and also use level to specify how much information'
complete -c gcc -o ggdblevel -d 'Request debug info and also use level to specify how much information'
complete -c gcc -o gstabslevel -d 'Request debug info and also use level to specify how much information'
complete -c gcc -o gcofflevel -d 'Request debug info and also use level to specify how much information'
complete -c gcc -o gxcofflevel -d 'Request debug info and also use level to specify how much information'
complete -c gcc -o gvmslevel -d 'Request debug info and also use level to specify how much information'
complete -c gcc -o feliminate-dwarf2-dups -d 'Compress DWARF2 debug info by eliminating duplicated information about each symbol'
complete -c gcc -s p -d 'Generate extra code to write profile information suitable for the analysis program prof'
complete -c gcc -o pg -d 'Generate extra code to write profile information suitable for the analysis program gprof'
complete -c gcc -s Q -d 'Makes the compiler print out each function name as it is compiled, and print some statistics about each pass when it finishes'
@@ -277,7 +276,7 @@ complete -c gcc -o foptimize-sibling-calls -d 'Optimize sibling and tail recursi
complete -c gcc -o fno-inline -d 'Dont pay attention to the "inline" keyword'
complete -c gcc -o finline-functions -d 'Integrate all simple functions into their callers'
complete -c gcc -o finline-functions-called-once -d 'Consider all "static" functions called once for inlining into their caller even if they are not marked "inline"'
complete -c gcc -o fearly-inlining -d 'Inline functions marked by "always_inline" and functions whose body seems smaller than the function call overhead early before doing -fprofile-generate instrumentation and real inlining pass'
complete -c gcc -o fearly-inlining -d 'Inline functions marked by "always_inline" and small functions early'
complete -c gcc -o finline-limit -d 'By default, GCC limits the size of functions that can be inlined' -x -a "1 2 3 4 5"
complete -c gcc -o fkeep-inline-functions -d 'In C, emit "static" functions that are declared "inline" into the object file, even if the function has been inlined into all of its callers'
complete -c gcc -o fkeep-static-consts -d 'Emit variables declared "static const" when optimization isnt turned on, even if the variables arent referenced'
@@ -288,9 +287,6 @@ complete -c gcc -o fno-branch-count-reg -d 'Do not use "decrement and branch" in
complete -c gcc -o fno-function-cse -d 'Do not put function addresses in registers; make each instruction that calls a constant function contain the functions address explicitly'
complete -c gcc -o fno-zero-initialized-in-bss -d 'If the target supports a BSS section, GCC by default puts variables that are initialized to zero into BSS'
complete -c gcc -o fbounds-check -d 'For front-ends that support it, generate additional code to check that indices used to access arrays are within the declared range'
complete -c gcc -o fmudflap -d 'For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests'
complete -c gcc -o fmudflapth -d 'For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests'
complete -c gcc -o fmudflapir -d 'For front-ends that support it (C and C++), instrument all risky pointer/array dereferencing operations, some standard library string/heap functions, and some other associated constructs with range/validity tests'
complete -c gcc -o fstrength-reduce -d 'Perform the optimizations of loop strength reduction and elimination of iteration variables'
complete -c gcc -o fthread-jumps -d 'Perform optimizations where we check to see if a jump branches to a location where another comparison subsumed by the first is found'
complete -c gcc -o fcse-follow-jumps -d 'In common subexpression elimination, scan through jump instructions when the target of the jump is not reached by any other path'
@@ -312,19 +308,19 @@ complete -c gcc -o fdelete-null-pointer-checks -d 'Use global dataflow analysis
complete -c gcc -o fexpensive-optimizations -d 'Perform a number of minor optimizations that are relatively expensive'
complete -c gcc -o foptimize-register-move -d 'Attempt to reassign register numbers in move instructions and as operands of other simple instructions in order to maximize the amount of register tying'
complete -c gcc -o fregmove -d 'Attempt to reassign register numbers in move instructions and as operands of other simple instructions in order to maximize the amount of register tying'
complete -c gcc -o fdelayed-branch -d 'If supported for the target machine, attempt to reorder instructions to exploit instruction slots available after delayed branch instructions'
complete -c gcc -o fschedule-insns -d 'If supported for the target machine, attempt to reorder instructions to eliminate execution stalls due to required data being unavailable'
complete -c gcc -o fschedule-insns2 -d 'Similar to -fschedule-insns, but requests an additional pass of instruction scheduling after register allocation has been done'
complete -c gcc -o fdelayed-branch -d 'Try to reorder instructions to exploit instruction slots available after delayed branch instructions'
complete -c gcc -o fschedule-insns -d 'Try to reorder instructions to eliminate execution stalls due to required data being unavailable'
complete -c gcc -o fschedule-insns2 -d '-fschedule-insns, but request an additional pass of instruction scheduling after register allocation'
complete -c gcc -o fno-sched-interblock -d 'Dont schedule instructions across basic blocks'
complete -c gcc -o fno-sched-spec -d 'Dont allow speculative motion of non-load instructions'
complete -c gcc -o fsched-spec-load -d 'Allow speculative motion of some load instructions'
complete -c gcc -o fsched-spec-load-dangerous -d 'Allow speculative motion of more load instructions'
complete -c gcc -o fsched-stalled-insns -d 'Define how many insns (if any) can be moved prematurely from the queue of stalled insns into the ready list, during the second scheduling pass'
complete -c gcc -o fsched-stalled-insns-dep -d 'Define how many insn groups (cycles) will be examined for a dependency on a stalled insn that is candidate for premature removal from the queue of stalled insns'
complete -c gcc -o fsched-stalled-insns -d 'Define how many insns can be moved from the queue of stalled insns into the ready list, during the second scheduling pass'
complete -c gcc -o fsched-stalled-insns-dep -d 'Define how many insn groups will be examined for a dependency on a stalled insn that is candidate for premature removal from the queue of stalled insns'
complete -c gcc -o fsched2-use-superblocks -d 'When scheduling after register allocation, do use superblock scheduling algorithm'
complete -c gcc -o fsched2-use-traces -d 'Use -fsched2-use-superblocks algorithm when scheduling after register allocation and additionally perform code duplication in order to increase the size of superblocks using tracer pass'
complete -c gcc -o freschedule-modulo-scheduled-loops -d 'The modulo scheduling comes before the traditional scheduling, if a loop was modulo scheduled we may want to prevent the later scheduling passes from changing its schedule, we use this option to control that'
complete -c gcc -o fcaller-saves -d 'Enable values to be allocated in registers that will be clobbered by function calls, by emitting extra instructions to save and restore the registers around such calls'
complete -c gcc -o fcaller-saves -d 'Allocate in registers that will be clobbered by function calls, by saving and restoring'
complete -c gcc -o ftree-pre -d 'Perform Partial Redundancy Elimination (PRE) on trees'
complete -c gcc -o ftree-fre -d 'Perform Full Redundancy Elimination (FRE) on trees'
complete -c gcc -o ftree-copy-prop -d 'Perform copy propagation on trees'
@@ -353,22 +349,18 @@ complete -c gcc -o funroll-loops -d 'Unroll loops whose number of iterations can
complete -c gcc -o funroll-all-loops -d 'Unroll all loops, even if their number of iterations is uncertain when the loop is entered'
complete -c gcc -o fsplit-ivs-in-unroller -d 'Enables expressing of values of induction variables in later iterations of the unrolled loop using the value in the first iteration'
complete -c gcc -o fvariable-expansion-in-unroller -d 'With this option, the compiler will create multiple copies of some local variables when unrolling a loop which can result in superior code'
complete -c gcc -o fprefetch-loop-arrays -d 'If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays'
complete -c gcc -o fprefetch-loop-arrays -d 'Generate instructions to prefetch memory to improve the performance of loops that access large arrays'
complete -c gcc -o fno-peephole -d 'Disable any machine-specific peephole optimizations'
complete -c gcc -o fno-peephole2 -d 'Disable any machine-specific peephole optimizations'
complete -c gcc -o fno-guess-branch-probability -d 'Do not guess branch probabilities using heuristics'
complete -c gcc -o freorder-blocks -d 'Reorder basic blocks in the compiled function in order to reduce number of taken branches and improve code locality'
complete -c gcc -o freorder-blocks-and-partition -d 'In addition to reordering basic blocks in the compiled function, in order to reduce number of taken branches, partitions hot and cold basic blocks into separate sections of the assembly and '
complete -c gcc -o freorder-blocks -d 'Reorder basic blocks in the compiled function to reduce number of taken branches and improve code locality'
complete -c gcc -o freorder-blocks-and-partition -d 'Reorder basic blocks in the compiled function and partition hot and cold blocks'
complete -c gcc -o freorder-functions -d 'Reorder functions in the object file in order to improve code locality'
complete -c gcc -o fstrict-aliasing -d 'Allows the compiler to assume the strictest aliasing rules applicable to the language being compiled'
complete -c gcc -o falign-functions -d 'Align the start of functions to the next power-of-two greater than n, skipping up to n bytes'
complete -c gcc -o falign-functions -d 'Align the start of functions to the next power-of-two greater than n, skipping up to n bytes'
complete -c gcc -o falign-labels -d 'Align all branch targets to a power-of-two boundary, skipping up to n bytes like -falign-functions'
complete -c gcc -o falign-labels -d 'Align all branch targets to a power-of-two boundary, skipping up to n bytes like -falign-functions'
complete -c gcc -o falign-loops -d 'Align loops to a power-of-two boundary, skipping up to n bytes like -falign-functions'
complete -c gcc -o falign-loops -d 'Align loops to a power-of-two boundary, skipping up to n bytes like -falign-functions'
complete -c gcc -o falign-jumps -d 'Align branch targets to a power-of-two boundary, for branch targets where the targets can only be reached by jumping, skipping up to n bytes like -falign-functions'
complete -c gcc -o falign-jumps -d 'Align branch targets to a power-of-two boundary, for branch targets where the targets can only be reached by jumping, skipping up to n bytes like -falign-functions'
complete -c gcc -o falign-jumps -d 'Align branch targets to a power-of-two, skipping bytes'
complete -c gcc -o funit-at-a-time -d 'Parse the whole compilation unit before starting to produce code'
complete -c gcc -o fweb -d 'Constructs webs as commonly used for register allocation purposes and assign each web individual pseudo register'
complete -c gcc -o fwhole-program -d 'Assume that the current compilation unit represents whole program being compiled'
@@ -376,7 +368,7 @@ complete -c gcc -o fno-cprop-registers -d 'After register allocation and post-re
complete -c gcc -o fprofile-generate -d 'Enable options usually used for instrumenting application to produce profile useful for later recompilation with profile feedback based optimization'
complete -c gcc -o fprofile-use -d 'Enable profile feedback directed optimizations, and optimizations generally profitable only with profile feedback available'
complete -c gcc -o ffloat-store -d 'Do not store floating point variables in registers, and inhibit other options that might change whether a floating point value is taken from a register or memory'
complete -c gcc -o ffast-math -d 'Sets -fno-math-errno, -funsafe-math-optimizations, -fno-trapping-math, -ffinite-math-only, -fno-rounding-math, -fno-signaling-nans and fcx-limited-range'
complete -c gcc -o ffast-math -d 'Set a bunch of inadvisable math options to make it faster'
complete -c gcc -o fno-math-errno -d 'Do not set ERRNO after calling math functions that are executed with a single instruction, e'
complete -c gcc -o funsafe-math-optimizations -d 'Allow optimizations for floating-point arithmetic that (a) assume that arguments and results are valid and (b) may violate IEEE or ANSI standards'
complete -c gcc -o ffinite-math-only -d 'Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs'
@@ -396,7 +388,7 @@ complete -c gcc -o funroll-all-loops -d 'Unroll all loops, even if their number
complete -c gcc -o fpeel-loops -d 'Peels the loops for that there is enough information that they do not roll much (from profile feedback)'
complete -c gcc -o fmove-loop-invariants -d 'Enables the loop invariant motion pass in the new loop optimizer'
complete -c gcc -o funswitch-loops -d 'Move branches with loop invariant conditions out of the loop, with duplicates of the loop on both branches (modified according to result of the condition)'
complete -c gcc -o fprefetch-loop-arrays -d 'If supported by the target machine, generate instructions to prefetch memory to improve the performance of loops that access large arrays'
complete -c gcc -o fprefetch-loop-arrays -d 'Generate instructions to prefetch memory to improve the performance of loops that access large arrays'
complete -c gcc -o ffunction-sections -d 'Place each function or data item into its own section in the output file if the target supports arbitrary sections'
complete -c gcc -o fdata-sections -d 'Place each function or data item into its own section in the output file if the target supports arbitrary sections'
complete -c gcc -o fbranch-target-load-optimize -d 'Perform branch target register load optimization before prologue / epilogue threading'
@@ -615,64 +607,65 @@ complete -c gcc -o bundle -d 'Produce a Mach-o bundle format file'
complete -c gcc -o bundle_loader -d 'This option specifies the executable that will be loading the build output file being linked'
complete -c gcc -o dynamiclib -d 'When passed this option, GCC will produce a dynamic library instead of an executable when linking, using the Darwin libtool command'
complete -c gcc -o force_cpusubtype_ALL -d 'This causes GCCs output file to have the ALL subtype, instead of one controlled by the -mcpu or -march option'
complete -c gcc -o allowable_client -d 'These options are passed to the Darwin linker'
complete -c gcc -o client_name -d 'These options are passed to the Darwin linker'
complete -c gcc -o compatibility_version -d 'These options are passed to the Darwin linker'
complete -c gcc -o current_version -d 'These options are passed to the Darwin linker'
complete -c gcc -o dead_strip -d 'These options are passed to the Darwin linker'
complete -c gcc -o dependency-file -d 'These options are passed to the Darwin linker'
complete -c gcc -o dylib_file -d 'These options are passed to the Darwin linker'
complete -c gcc -o dylinker_install_name -d 'These options are passed to the Darwin linker'
complete -c gcc -o dynamic -d 'These options are passed to the Darwin linker'
complete -c gcc -o exported_symbols_list -d 'These options are passed to the Darwin linker'
complete -c gcc -o filelist -d 'These options are passed to the Darwin linker'
complete -c gcc -o flat_namespace -d 'These options are passed to the Darwin linker'
complete -c gcc -o force_flat_namespace -d 'These options are passed to the Darwin linker'
complete -c gcc -o headerpad_max_install_names -d 'These options are passed to the Darwin linker'
complete -c gcc -o image_base -d 'These options are passed to the Darwin linker'
complete -c gcc -o init -d 'These options are passed to the Darwin linker'
complete -c gcc -o install_name -d 'These options are passed to the Darwin linker'
complete -c gcc -o keep_private_externs -d 'These options are passed to the Darwin linker'
complete -c gcc -o multi_module -d 'These options are passed to the Darwin linker'
complete -c gcc -o multiply_defined -d 'These options are passed to the Darwin linker'
complete -c gcc -o multiply_defined_unused -d 'These options are passed to the Darwin linker'
complete -c gcc -o noall_load -d 'These options are passed to the Darwin linker'
complete -c gcc -o no_dead_strip_inits_and_terms -d 'These options are passed to the Darwin linker'
complete -c gcc -o nofixprebinding -d 'These options are passed to the Darwin linker'
complete -c gcc -o nomultidefs -d 'These options are passed to the Darwin linker'
complete -c gcc -o noprebind -d 'These options are passed to the Darwin linker'
complete -c gcc -o noseglinkedit -d 'These options are passed to the Darwin linker'
complete -c gcc -o pagezero_size -d 'These options are passed to the Darwin linker'
complete -c gcc -o prebind -d 'These options are passed to the Darwin linker'
complete -c gcc -o prebind_all_twolevel_modules -d 'These options are passed to the Darwin linker'
complete -c gcc -o private_bundle -d 'These options are passed to the Darwin linker'
complete -c gcc -o read_only_relocs -d 'These options are passed to the Darwin linker'
complete -c gcc -o sectalign -d 'These options are passed to the Darwin linker'
complete -c gcc -o sectobjectsymbols -d 'These options are passed to the Darwin linker'
complete -c gcc -o whyload -d 'These options are passed to the Darwin linker'
complete -c gcc -o seg1addr -d 'These options are passed to the Darwin linker'
complete -c gcc -o sectcreate -d 'These options are passed to the Darwin linker'
complete -c gcc -o sectobjectsymbols -d 'These options are passed to the Darwin linker'
complete -c gcc -o sectorder -d 'These options are passed to the Darwin linker'
complete -c gcc -o segaddr -d 'These options are passed to the Darwin linker'
complete -c gcc -o segs_read_only_addr -d 'These options are passed to the Darwin linker'
complete -c gcc -o segs_read_write_addr -d 'These options are passed to the Darwin linker'
complete -c gcc -o seg_addr_table -d 'These options are passed to the Darwin linker'
complete -c gcc -o seg_addr_table_filename -d 'These options are passed to the Darwin linker'
complete -c gcc -o seglinkedit -d 'These options are passed to the Darwin linker'
complete -c gcc -o segprot -d 'These options are passed to the Darwin linker'
complete -c gcc -o segs_read_only_addr -d 'These options are passed to the Darwin linker'
complete -c gcc -o segs_read_write_addr -d 'These options are passed to the Darwin linker'
complete -c gcc -o single_module -d 'These options are passed to the Darwin linker'
complete -c gcc -o static -d 'These options are passed to the Darwin linker'
complete -c gcc -o sub_library -d 'These options are passed to the Darwin linker'
complete -c gcc -o sub_umbrella -d 'These options are passed to the Darwin linker'
complete -c gcc -o twolevel_namespace -d 'These options are passed to the Darwin linker'
complete -c gcc -o umbrella -d 'These options are passed to the Darwin linker'
complete -c gcc -o undefined -d 'These options are passed to the Darwin linker'
complete -c gcc -o unexported_symbols_list -d 'These options are passed to the Darwin linker'
complete -c gcc -o weak_reference_mismatches -d 'These options are passed to the Darwin linker'
complete -c gcc -o whatsloaded -d 'These options are passed to the Darwin linker'
# TODO: These options would be taken as one, so they're useless
# complete -c gcc -o allowable_client -d 'These options are passed to the Darwin linker'
# complete -c gcc -o client_name -d 'These options are passed to the Darwin linker'
# complete -c gcc -o compatibility_version -d 'These options are passed to the Darwin linker'
# complete -c gcc -o current_version -d 'These options are passed to the Darwin linker'
# complete -c gcc -o dead_strip -d 'These options are passed to the Darwin linker'
# complete -c gcc -o dependency-file -d 'These options are passed to the Darwin linker'
# complete -c gcc -o dylib_file -d 'These options are passed to the Darwin linker'
# complete -c gcc -o dylinker_install_name -d 'These options are passed to the Darwin linker'
# complete -c gcc -o dynamic -d 'These options are passed to the Darwin linker'
# complete -c gcc -o exported_symbols_list -d 'These options are passed to the Darwin linker'
# complete -c gcc -o filelist -d 'These options are passed to the Darwin linker'
# complete -c gcc -o flat_namespace -d 'These options are passed to the Darwin linker'
# complete -c gcc -o force_flat_namespace -d 'These options are passed to the Darwin linker'
# complete -c gcc -o headerpad_max_install_names -d 'These options are passed to the Darwin linker'
# complete -c gcc -o image_base -d 'These options are passed to the Darwin linker'
# complete -c gcc -o init -d 'These options are passed to the Darwin linker'
# complete -c gcc -o install_name -d 'These options are passed to the Darwin linker'
# complete -c gcc -o keep_private_externs -d 'These options are passed to the Darwin linker'
# complete -c gcc -o multi_module -d 'These options are passed to the Darwin linker'
# complete -c gcc -o multiply_defined -d 'These options are passed to the Darwin linker'
# complete -c gcc -o multiply_defined_unused -d 'These options are passed to the Darwin linker'
# complete -c gcc -o noall_load -d 'These options are passed to the Darwin linker'
# complete -c gcc -o no_dead_strip_inits_and_terms -d 'These options are passed to the Darwin linker'
# complete -c gcc -o nofixprebinding -d 'These options are passed to the Darwin linker'
# complete -c gcc -o nomultidefs -d 'These options are passed to the Darwin linker'
# complete -c gcc -o noprebind -d 'These options are passed to the Darwin linker'
# complete -c gcc -o noseglinkedit -d 'These options are passed to the Darwin linker'
# complete -c gcc -o pagezero_size -d 'These options are passed to the Darwin linker'
# complete -c gcc -o prebind -d 'These options are passed to the Darwin linker'
# complete -c gcc -o prebind_all_twolevel_modules -d 'These options are passed to the Darwin linker'
# complete -c gcc -o private_bundle -d 'These options are passed to the Darwin linker'
# complete -c gcc -o read_only_relocs -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sectalign -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sectobjectsymbols -d 'These options are passed to the Darwin linker'
# complete -c gcc -o whyload -d 'These options are passed to the Darwin linker'
# complete -c gcc -o seg1addr -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sectcreate -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sectobjectsymbols -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sectorder -d 'These options are passed to the Darwin linker'
# complete -c gcc -o segaddr -d 'These options are passed to the Darwin linker'
# complete -c gcc -o segs_read_only_addr -d 'These options are passed to the Darwin linker'
# complete -c gcc -o segs_read_write_addr -d 'These options are passed to the Darwin linker'
# complete -c gcc -o seg_addr_table -d 'These options are passed to the Darwin linker'
# complete -c gcc -o seg_addr_table_filename -d 'These options are passed to the Darwin linker'
# complete -c gcc -o seglinkedit -d 'These options are passed to the Darwin linker'
# complete -c gcc -o segprot -d 'These options are passed to the Darwin linker'
# complete -c gcc -o segs_read_only_addr -d 'These options are passed to the Darwin linker'
# complete -c gcc -o segs_read_write_addr -d 'These options are passed to the Darwin linker'
# complete -c gcc -o single_module -d 'These options are passed to the Darwin linker'
# complete -c gcc -o static -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sub_library -d 'These options are passed to the Darwin linker'
# complete -c gcc -o sub_umbrella -d 'These options are passed to the Darwin linker'
# complete -c gcc -o twolevel_namespace -d 'These options are passed to the Darwin linker'
# complete -c gcc -o umbrella -d 'These options are passed to the Darwin linker'
# complete -c gcc -o undefined -d 'These options are passed to the Darwin linker'
# complete -c gcc -o unexported_symbols_list -d 'These options are passed to the Darwin linker'
# complete -c gcc -o weak_reference_mismatches -d 'These options are passed to the Darwin linker'
# complete -c gcc -o whatsloaded -d 'These options are passed to the Darwin linker'
complete -c gcc -o mno-soft-float -d 'Use (do not use) the hardware floating-point instructions for floating-point operations'
complete -c gcc -o msoft-float -d 'Use (do not use) the hardware floating-point instructions for floating-point operations'
complete -c gcc -o mfp-reg -d 'Generate code that uses (does not use) the floating-point register set'
@@ -889,13 +882,11 @@ complete -c gcc -o memregs -d '=number Specifies the number of memory-based pseu
complete -c gcc -o m32r2 -d 'Generate code for the M32R/2'
complete -c gcc -o m32rx -d 'Generate code for the M32R/X'
complete -c gcc -o m32r -d 'Generate code for the M32R'
complete -c gcc -o mmodel -d '=small Assume all objects live in the lower 16MB of memory (so that their addresses can be loaded with the "ld24" instruction), and assume all subroutines are reachable with the "bl" instruction'
complete -c gcc -o mmodel -d '=medium Assume objects may be anywhere in the 32-bit address space (the compiler will generate "seth/add3" instructions to load their addresses), and assume all subroutines are reachable with the "bl" instruction'
complete -c gcc -o mmodel -d '=large Assume objects may be anywhere in the 32-bit address space (the compiler will generate "seth/add3" instructions to load their addresses), and assume subroutines may not be reachable with the "bl" instruction (the compiler will generate the much slower "seth/add3/jl" instruction sequence)'
complete -c gcc -o msdata -d '=none Disable use of the small data area'
complete -c gcc -o msdata -d '=sdata Put small global and static data in the small data area, but do not generate special code to reference them'
complete -c gcc -o msdata -d '=use Put small global and static data in the small data area, and generate special instructions to reference them'
complete -c gcc -s G -d 'Put global and static objects less than or equal to num bytes into the small data or bss sections instead of the normal data or bss sections'
complete -c gcc -o mmodel -xa "small\t'Assume all objects live in the lower 16MB of memory' medium\t'Assume objects may be anywhere in the 32-bit address space' large\t'assume subroutines may not be reachable with the bl instruction'"
complete -c gcc -o msdata -xa 'none\t"Disable use of the small data area"
sdata\t"Put small global and static data in the small data area, but do not generate special code to reference them"
use\t"Put small global and static data in the small data area, and generate special instructions to reference them"'
complete -c gcc -s G -d 'Put global and static objects less than or equal to num bytes into the small data or bss sections'
complete -c gcc -o mdebug -d 'Makes the M32R specific code in the compiler display some statistics that might help in debugging programs'
complete -c gcc -o malign-loops -d 'Align all loops to a 32-byte boundary'
complete -c gcc -o mno-align-loops -d 'Do not enforce a 32-byte alignment for loops'
@@ -1150,8 +1141,8 @@ complete -c gcc -o maix32 -d 'Enable 64-bit AIX ABI and calling convention: 64-b
complete -c gcc -o mxl-compat -d 'Produce code that conforms more closely to IBM XL compiler semantics when using AIX-compatible ABI'
complete -c gcc -o mno-xl-compat -d 'Produce code that conforms more closely to IBM XL compiler semantics when using AIX-compatible ABI'
complete -c gcc -o mpe -d 'Support IBM RS/6000 SP Parallel Environment (PE)'
complete -c gcc -o malign-natural -d 'On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option -malign-natural overrides the ABI-defined alignment of larger types, such as floating-point doubles, on their natural size-based boundary'
complete -c gcc -o malign-power -d 'On AIX, 32-bit Darwin, and 64-bit PowerPC GNU/Linux, the option -malign-natural overrides the ABI-defined alignment of larger types, such as floating-point doubles, on their natural size-based boundary'
complete -c gcc -o malign-natural -d 'Override ABI-defined alignment of larger types on their natural size-based boundary'
complete -c gcc -o malign-power -d 'Follow ABI-specified alignment rules'
complete -c gcc -o msoft-float -d 'Generate code that does not use (uses) the floating-point register set'
complete -c gcc -o mhard-float -d 'Generate code that does not use (uses) the floating-point register set'
complete -c gcc -o mmultiple -d 'Generate code that uses (does not use) the load multiple word instructions and the store multiple word instructions'
@@ -1311,10 +1302,10 @@ complete -c gcc -o mno-vis -d 'With -mvis, GCC generates code that takes advanta
complete -c gcc -o mlittle-endian -d 'Generate code for a processor running in little-endian mode'
complete -c gcc -o m32 -d 'Generate code for a 32-bit or 64-bit environment'
complete -c gcc -o m64 -d 'Generate code for a 32-bit or 64-bit environment'
complete -c gcc -o mcmodel -d '=medlow Generate code for the Medium/Low code model: 64-bit addresses, programs must be linked in the low 32 bits of memory'
complete -c gcc -o mcmodel -d '=medmid Generate code for the Medium/Middle code model: 64-bit addresses, programs must be linked in the low 44 bits of memory, the text and data segments must be less than 2GB in size and the data segment must be located within 2GB of the text segment'
complete -c gcc -o mcmodel -d '=medany Generate code for the Medium/Anywhere code model: 64-bit addresses, programs may be linked anywhere in memory, the text and data segments must be less than 2GB in size and the data segment must be located within 2GB of the text segment'
complete -c gcc -o mcmodel -d '=embmedany Generate code for the Medium/Anywhere code model for embedded systems: 64-bit addresses, the text and data segments must be less than 2GB in size, both starting anywhere in memory (determined at link time)'
complete -c gcc -o mcmodel -a 'medlow\t"Medium/Low code model: 64-bit addresses, programs must be linked in the low 32 bits of memory"
medmid\t"Medium/Middle code model: 64-bit addresses, programs must be linked in the low 44 bits of memory, the text/data segments must be less than 2GB in size and the data segment must be located within 2GB of the text segment"
medany\t"Medium/Anywhere code model: 64-bit addresses, programs may be linked anywhere in memory, the text and data segments must be less than 2GB in size and the data segment must be located within 2GB of the text segment"
embmedany\t"Medium/Anywhere code model for embedded systems: 64-bit addresses, the text and data segments must be less than 2GB in size, both starting anywhere in memory (determined at link time)"'
complete -c gcc -o mstack-bias -d 'With -mstack-bias, GCC assumes that the stack pointer, and frame pointer if present, are offset by -2047 which must be added back when making stack frame references'
complete -c gcc -o mno-stack-bias -d 'With -mstack-bias, GCC assumes that the stack pointer, and frame pointer if present, are offset by -2047 which must be added back when making stack frame references'
complete -c gcc -o threads -d 'Add support for multithreading using the Solaris threads library'
@@ -1380,15 +1371,15 @@ complete -c gcc -o mtext-section-literals -d 'Control the treatment of literal p
complete -c gcc -o mno-text-section-literals -d 'Control the treatment of literal pools'
complete -c gcc -o mtarget-align -d 'When this option is enabled, GCC instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density'
complete -c gcc -o mno-target-align -d 'When this option is enabled, GCC instructs the assembler to automatically align instructions to reduce branch penalties at the expense of some code density'
complete -c gcc -o mlongcalls -d 'When this option is enabled, GCC instructs the assembler to translate direct calls to indirect calls unless it can determine that the target of a direct call is in the range allowed by the call instruction'
complete -c gcc -o mno-longcalls -d 'When this option is enabled, GCC instructs the assembler to translate direct calls to indirect calls unless it can determine that the target of a direct call is in the range allowed by the call instruction'
complete -c gcc -o mlongcalls -d 'Tell assembler to translate direct calls to indirect calls'
complete -c gcc -o mno-longcalls -d 'Tell assembler to not translate direct calls to indirect calls'
complete -c gcc -o fbounds-check -d 'For front-ends that support it, generate additional code to check that indices used to access arrays are within the declared range'
complete -c gcc -o ftrapv -d 'This option generates traps for signed overflow on addition, subtraction, multiplication operations'
complete -c gcc -o fwrapv -d 'This option instructs the compiler to assume that signed arithmetic overflow of addition, subtraction and multiplication wraps around using twos-complement representation'
complete -c gcc -o fexceptions -d 'Enable exception handling'
complete -c gcc -o fnon-call-exceptions -d 'Generate code that allows trapping instructions to throw exceptions'
complete -c gcc -o funwind-tables -d 'Similar to -fexceptions, except that it will just generate any needed static data, but will not affect the generated code in any other way'
complete -c gcc -o fasynchronous-unwind-tables -d 'Generate unwind table in dwarf2 format, if supported by target machine'
complete -c gcc -o fasynchronous-unwind-tables -d 'Generate unwind table in dwarf2 format'
complete -c gcc -o fpcc-struct-return -d 'Return "short" "struct" and "union" values in memory like longer ones, rather than in registers'
complete -c gcc -o freg-struct-return -d 'Return "struct" and "union" values in registers when possible'
complete -c gcc -o fshort-enums -d 'Allocate to an "enum" type only as many bytes as it needs for the declared range of possible values'
@@ -1399,8 +1390,8 @@ complete -c gcc -o fno-common -d 'In C, allocate even uninitialized global varia
complete -c gcc -o fno-ident -d 'Ignore the #ident directive'
complete -c gcc -o finhibit-size-directive -d 'Dont output a "'
complete -c gcc -o fverbose-asm -d 'Put extra commentary information in the generated assembly code to make it more readable'
complete -c gcc -o fpic -d 'Generate position-independent code (PIC) suitable for use in a shared library, if supported for the target machine'
complete -c gcc -o fPIC -d 'If supported for the target machine, emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table'
complete -c gcc -o fpic -d 'Generate position-independent code (PIC) suitable for use in a shared library'
complete -c gcc -o fPIC -d 'Emit position-independent code, suitable for dynamic linking and avoiding any limit on the size of the global offset table'
complete -c gcc -o fpie -d 'These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables'
complete -c gcc -o fPIE -d 'These options are similar to -fpic and -fPIC, but generated position independent code can be only linked into executables'
complete -c gcc -o fno-jump-tables -d 'Do not use jump tables for switch statements even where it would be more efficient than other code generation strategies'

View File

@@ -324,33 +324,31 @@ function __fish_git_files
end
# Only try printing if the file was selected.
if set -q file[1]
for d in $desc
# Without "-z", git sometimes _quotes_ filenames.
# It adds quotes around it _and_ escapes the character.
# e.g. `"a\\b"`.
# We just remove the quotes and hope it works out.
# If this contains newlines or tabs,
# there is nothing we can do, but that's a general issue with scripted completions.
set file (string trim -c \" -- $file)
# The relative filename.
if string match -q './*' -- (commandline -ct)
printf './%s\t%s\n' $file $d
else
printf '%s\t%s\n' "$file" $d
end
# Now from repo root.
# Only do this if the filename isn't a simple child,
# or the current token starts with ":"
if string match -q '../*' -- $file
or string match -q ':*' -- (commandline -ct)
set -l fromroot (builtin realpath -- $file 2>/dev/null)
# `:` starts pathspec "magic", and the second `:` terminates it.
# `/` is the magic letter for "from repo root".
# If we didn't terminate it we'd have to escape any special chars
# (non-alphanumeric, glob or regex special characters, in whatever dialect git uses)
and set fromroot (string replace -- "$root/" ":/:" "$fromroot")
and printf '%s\t%s\n' "$fromroot" $d
end
# Without "-z", git sometimes _quotes_ filenames.
# It adds quotes around it _and_ escapes the character.
# e.g. `"a\\b"`.
# We just remove the quotes and hope it works out.
# If this contains newlines or tabs,
# there is nothing we can do, but that's a general issue with scripted completions.
set file (string trim -c \" -- $file)
# The relative filename.
if string match -q './*' -- (commandline -ct)
printf './%s\n' $file\t$desc
else
printf '%s\n' "$file"\t$desc
end
# Now from repo root.
# Only do this if the filename isn't a simple child,
# or the current token starts with ":"
if string match -q '../*' -- $file
or string match -q ':*' -- (commandline -ct)
set -l fromroot (builtin realpath -- $file 2>/dev/null)
# `:` starts pathspec "magic", and the second `:` terminates it.
# `/` is the magic letter for "from repo root".
# If we didn't terminate it we'd have to escape any special chars
# (non-alphanumeric, glob or regex special characters, in whatever dialect git uses)
and set fromroot (string replace -- "$root/" ":/:" "$fromroot")
and printf '%s\n' "$fromroot"\t$desc
end
end
end
@@ -2041,7 +2039,7 @@ complete -f -c git -n '__fish_git_using_command tag' -s v -l verify -d 'Verify s
complete -f -c git -n '__fish_git_using_command tag' -s f -l force -d 'Force overwriting existing tag'
complete -f -c git -n '__fish_git_using_command tag' -s l -l list -d 'List tags'
complete -f -c git -n '__fish_git_using_command tag' -l contains -xka '(__fish_git_commits)' -d 'List tags that contain a commit'
complete -f -c git -n '__fish_git_using_command tag' -n '__fish_git_contains_opt -s d delete -s v verify -s f force' -ka '(__fish_git_tags)' -d Tag
complete -f -c git -n '__fish_git_using_command tag' -n '__fish_git_contains_opt -s d delete -s v verify' -ka '(__fish_git_tags)' -d Tag
# TODO options
### worktree

View File

@@ -1,5 +1,9 @@
complete -c gunzip -s c -l stdout -d "Compress to stdout"
complete -c gunzip -k -x -a "(__fish_complete_suffix .gz .tgz)"
complete -c gunzip -k -x -a "(
__fish_complete_suffix .gz
__fish_complete_suffix .tgz
)
"
complete -c gunzip -s f -l force -d Overwrite
complete -c gunzip -s h -l help -d "Display help and exit"
complete -c gunzip -s k -l keep -d "Keep input files"

View File

@@ -1,4 +1,7 @@
complete -c gv -k -xa "(__fish_complete_suffix .ps .ps.gz .eps .pdf)"
complete -c gv -k -xa "(__fish_complete_suffix .ps)"
complete -c gv -k -xa "(__fish_complete_suffix .ps.gz)"
complete -c gv -k -xa "(__fish_complete_suffix .eps)"
complete -c gv -k -xa "(__fish_complete_suffix .pdf)"
complete -c gv -l monochrome -d 'Display document using only black and white'
complete -c gv -l grayscale -d 'Display document without colors'
complete -c gv -l color -d 'Display document as usual'

View File

@@ -1,5 +1,10 @@
complete -c gzip -s c -l stdout -d "Compress to stdout"
complete -c gzip -s d -l decompress -k -x -a "(__fish_complete_suffix .gz .tgz)"
complete -c gzip -s d -l decompress -k -x -a "
(
__fish_complete_suffix .gz
__fish_complete_suffix .tgz
)
"
complete -c gzip -s f -l force -d Overwrite
complete -c gzip -s h -l help -d "Display help and exit"

View File

@@ -11,4 +11,4 @@ complete -c hjson -n __fish_should_complete_switches -a -rt -d "round trip comme
complete -c hjson -n __fish_should_complete_switches -a -nocol -d "disable color output"
complete -c hjson -n __fish_should_complete_switches -a "-cond=" -d "set condense option [default 60]"
complete -c hjson -k -xa "(__fish_complete_suffix .hjson .json)"
complete -c hjson -k -xa "(__fish_complete_suffix .hjson; __fish_complete_suffix .json)"

View File

@@ -1,9 +1,5 @@
function __fish_print_debian_services --description 'Prints services installed'
for service in /etc/init.d/*
if test -x $service
basename $service
end
end
path filter -fxZ /etc/init.d/* | path basename
end
function __fish_invoke_rcd_has_service

View File

@@ -12,7 +12,7 @@ complete -c kak -o q -d 'in filter mode be quiet about errors applying keys'
complete -c kak -o ui -x -a 'ncurses dummy json' -d 'set the type of user interface to use'
complete -c kak -o l -d 'list existing sessions'
complete -c kak -o clear -d 'clear dead sessions'
complete -c kak -o debug -x -d 'initial debug option value'
complete -c kak -o debug -x -d 'initial debug option value' -a 'hooks shell profile keys commands'
complete -c kak -o version -d 'display kakoune version and exit'
complete -c kak -o ro -d 'readonly mode'
complete -c kak -o help -d 'display a help message and quit'

View File

@@ -5,4 +5,4 @@ set -l commands add edit list view grep update delete template import export era
complete -c kb -s h -l help -d 'Show help and exit'
complete -c kb -l version -d 'Show version and exit'
complete -c kb -n "not __fish_seen_subcommand_from $commands" -a $commands
complete -c kb -n "not __fish_seen_subcommand_from $commands" -a "$commands"

View File

@@ -25,7 +25,7 @@ complete -c killall -xa '(__fish_complete_proc | string replace -r -- "^-" "")'
if killall --version >/dev/null 2>/dev/null # GNU
complete -c killall -s e -l exact -d 'Require an exact match for very long names'
complete -c killall -s I -l ignore-case -d 'Do case insensitive process name match'
complete -c killall -s g -l process-group -d 'Kill the process group to which the process belongs. The kill signal is only sent once per group, even if multiple processes belonging to the same process group were found'
complete -c killall -s g -l process-group -d 'Kill the process group to which the process belongs with one signal'
complete -c killall -s i -l interactive -d 'Interactively ask for confirmation before killing'
complete -c killall -s u -l user -x -a "(__fish_complete_users)" -d 'Kill only processes the specified user owns. Command names are optional'
complete -c killall -s w -l wait -d 'Wait for all killed processes to die'

View File

@@ -1,6 +1,6 @@
# Completions for the FreeBSD `kldload` kernel module load utility
function __fish_list_kldload_options
set -l klds (__fish_complete_suffix --complete=/boot/kernel/(commandline -ct) ".ko" | string replace -r '.*/(.+)\\.ko' '$1')
set -l klds (__fish_complete_suffix /boot/kernel/(commandline -ct) ".ko" | string replace -r '.*/(.+)\\.ko' '$1')
# Completing available klds is fast, but completing it with a call to __fish_whatis
# is decidedly not. With 846 modules (FreeBSD 11.1), fish --profile 'complete -C"kldload "' returns the following:
# 10671 11892698 > complete -C"kldload "

View File

@@ -6,6 +6,6 @@
# kmutil <clear-staging|trigger-panic-medic>
# kmutil -h
if test (command -v kmutil) = /usr/bin/kmutil
if test "$(command -s kmutil)" = /usr/bin/kmutil
command kmutil --generate-completion-script=fish | source
end

View File

@@ -1,4 +1,4 @@
complete -c latexmk -k -x -a "(__fish_complete_suffix --description='(La)TeX file' .tex)"
complete -c latexmk -k -x -a "(__fish_complete_suffix (commandline -ct) .tex '(La)TeX file')"
complete -c latexmk -o bibtex -d 'use bibtex when needed (default)'
complete -c latexmk -o bibtex- -d 'never use bibtex'
complete -c latexmk -o bibtex-cond -d 'use bibtex when needed, but only if the bib files exist'

View File

@@ -1,5 +1,6 @@
__fish_complete_lpr lp
complete -c lpr -k -xa "(__fish_complete_suffix .pdf .ps)"
complete -c lpr -k -xa "(__fish_complete_suffix .pdf)"
complete -c lpr -k -xa "(__fish_complete_suffix .ps)"
complete -c lp -s d -d 'Prints files to the named printer' -xa '(__fish_print_lpr_printers)'
complete -c lp -s i -d 'Specifies an existing job to modify' -x
complete -c lp -s n -d 'Sets the number of copies to print from 1 to 100' -x

View File

@@ -8,7 +8,7 @@ complete -c lpadmin -s v -d 'Sets the device-uri attribute of the printer queue'
complete -c lpadmin -s D -d 'Provides a textual description of the destination' -x
complete -c lpadmin -s E -d 'Enables the destination and accepts jobs'
complete -c lpadmin -s L -d 'Provides a textual location of the destination' -x
complete -c lpadmin -s P -d 'Specify a PDD file to use with the printer' -k -xa "(__fish_complete_suffix .ppd .ppd.gz)"
complete -c lpadmin -s P -d 'Specify a PDD file to use with the printer' -k -xa "(__fish_complete_suffix .ppd; __fish_complete_suffix .ppd.gz)"
complete -c lpadmin -s o -xa cupsIPPSupplies=true -d 'Specify if IPP supply level values should be reported'
complete -c lpadmin -s o -xa cupsIPPSupplies=false -d 'Specify if IPP supply level values should be reported'
complete -c lpadmin -s o -xa cupsSNMPSupplies=true -d 'Specify if SNMP supply level values should be reported'

View File

@@ -1,5 +1,6 @@
__fish_complete_lpr lpr
complete -c lpr -k -xa "(__fish_complete_suffix .pdf .ps)"
complete -c lpr -k -xa "(__fish_complete_suffix .pdf)"
complete -c lpr -k -xa "(__fish_complete_suffix .ps)"
complete -c lpr -s H -x -d 'Specifies an alternate server' -xa '(__fish_print_hostnames)'
complete -c lpr -s C -s J -s T -x -d 'Sets the job name'
#complete -c lpr -o '\\#' -d 'Sets the number of copies to print from 1 to 100' -xa

View File

@@ -6,7 +6,7 @@ set -l flavor
if string match -rq -- '^OpenBSD netcat' (nc -h 2>&1)[1]
set flavor nc.openbsd
else
set flavor (basename (realpath (command -v nc)))
set flavor (command -s netcat | path resolve | path basename)
end
__fish_complete_netcat nc $flavor

View File

@@ -6,7 +6,7 @@ set -l flavor
if string match -rq -- '^OpenBSD netcat' (netcat -h 2>&1)[1]
set flavor nc.openbsd
else
set flavor (basename (realpath (command -v netcat)))
set flavor (command -s netcat | path resolve | path basename)
end
__fish_complete_netcat netcat $flavor

View File

@@ -13,7 +13,7 @@ end
# The results of this function are as if __fish_complete_suffix were called
# while cd'd into the openocd scripts directory
function __fish_complete_openocd_path
__fish_complete_suffix --prefix=(__fish_openocd_prefix)/share/openocd/scripts "$argv[1]"
__fish_complete_suffix (commandline -ct) "$argv[1]" "$argv[2]" (__fish_openocd_prefix)/share/openocd/scripts
end
complete -c openocd -f # at no point does openocd take arbitrary arguments

View File

@@ -37,6 +37,6 @@ complete -x -c optipng -n __fish_should_complete_switches -a '-dir\t"write outpu
complete -x -c optipng -n __fish_should_complete_switches -a '-log\t"log messages to <file>"'
complete -x -c optipng -n 'not __fish_prev_arg_in -out -dir -log' \
-k -a '(__fish_complete_suffix .png .pnm .tiff .bmp)'
-k -a '(__fish_complete_suffix .png; __fish_complete_suffix .pnm; __fish_complete_suffix .tiff; __fish_complete_suffix .bmp)'
complete -x -c optipng -n '__fish_prev_arg_in -dir' -a '(__fish_complete_directories)'

View File

@@ -159,4 +159,4 @@ complete -c $progname -n "$files" -l machinereadable -d 'Show in machine readabl
# Upgrade options
# Theoretically, pacman reads packages in all formats that libarchive supports
# In practice, it's going to be tar.xz or tar.gz or tar.zst
complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst pkg.tar.xz pkg.tar.gz)' -d 'Package file'
complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst; __fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz)' -d 'Package file'

View File

@@ -141,4 +141,4 @@ complete -c $progname -n "$sync" -xa "$listall $listgroups"
# Upgrade options
# Theoretically, pacman reads packages in all formats that libarchive supports
# In practice, it's going to be tar.xz, tar.gz, tar.zst, or just pkg.tar (uncompressed pkg)
complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst pkg.tar.xz pkg.tar.gz pkg.tar)' -d 'Package file'
complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst; __fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz; __fish_complete_suffix pkg.tar;)' -d 'Package file'

View File

@@ -2,14 +2,14 @@
# Copyright (c) 2018 David Sanson
# Licensed under the GNU General Public License version 2
set -l informats (pandoc --list-input-formats)
set -l outformats (pandoc --list-output-formats)
set -l highlight_styles (pandoc --list-highlight-styles)
set -l informats commonmark creole docbook docx epub gfm haddock html jats json latex markdown markdown_github markdown_mmd markdown_phpextra markdown_strict mediawiki muse native odt opml org rst t2t textile tikiwiki twiki vimwiki
set -l outformats asciidoc beamer commonmark context docbook docbook4 docbook5 docx dokuwiki dzslides epub epub2 epub3 fb2 gfm haddock html html4 html5 icml jats json latex man markdown markdown_github markdown_mmd markdown_phpextra markdown_strict mediawiki ms muse native odt opendocument opml org plain pptx revealjs rst rtf s5 slideous slidy tei texinfo textile zimwiki
set -l highlight_styles pygments tango espresso zenburn kate monochrome breezedark haddock
set -l datadir $HOME/.pandoc
# Only suggest installed engines
set -l pdfengines
for engine in pdflatex lualatex xelatex latexmk tectonic wkhtmltopdf weasyprint pagedjs-cli prince context pdfroff
for engine in pdflatex lualatex xelatex wkhtmltopdf weasyprint prince context pdfroff
if type -q $engine
set pdfengines $pdfengines $engine
end
@@ -83,8 +83,18 @@ complete -c pandoc -r -l citation-abbreviations
complete -c pandoc -r -f -l print-highlight-style -k -a "(__fish_complete_suffix 'theme' )"
complete -c pandoc -r -f -l highlight_style -k -a "(__fish_complete_suffix 'theme' )"
complete -c pandoc -r -f -l csl -k -a "(__fish_complete_suffix 'csl' )"
complete -c pandoc -r -f -l reference-file -k -a "(__fish_complete_suffix 'odt' 'docx')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'bib' 'bibtex' 'copac' 'json' 'yaml' 'enl' 'xml' 'wos' 'medline' 'mods' 'ria')"
complete -c pandoc -r -f -l reference-file -k -a "(__fish_complete_suffix 'odt') (__fish_complete_suffix 'docx')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'bib')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'bibtex')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'copac')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'json')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'yaml')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'enl')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'xml')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'wos')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'medline')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'mods')"
complete -c pandoc -r -f -l bibliography -k -a "(__fish_complete_suffix 'ria')"
complete -c pandoc -r -f -l lua-filter -k -a "(__fish_complete_suffix 'lua')"
# options that take files in DATADIR

View File

@@ -17,7 +17,7 @@ complete -c patch -s f -l force -d "Like -t, but ignore bad-Prereq patches, assu
complete -c patch -s F -l fuzz -x -d "Number of LINES for inexact 'fuzzy' matching" -a "(seq 0 9){\tfuzz lines}"
complete -c patch -s g -l get -x -d "Get files from RCS etc. if positive; ask if negative" -a '(seq -1 1){\t\n}'
complete -c patch -l help -f -d "Display help"
complete -c patch -s i -l input -x -d "Read patch from FILE instead of stdin" -k -a "( __fish_complete_suffix .patch .diff)"
complete -c patch -s i -l input -x -d "Read patch from FILE instead of stdin" -k -a "( __fish_complete_suffix .patch; __fish_complete_suffix .diff)"
complete -c patch -s l -l ignore-whitespace -d "Ignore whitespace changes between patch & input"
complete -c patch -s n -l normal -d "Interpret patch as normal diff"
complete -c patch -s N -l forward -d "Ignore patches that seem reversed or already applied"

View File

@@ -95,7 +95,7 @@ complete -f -c phpunit -l do-not-cache-result -d 'Do not write test results to c
# Configuration Options:
complete -x -c phpunit -l prepend -d 'A PHP script that is included as early as possible'
complete -x -c phpunit -l bootstrap -d 'A PHP script that is included before the tests run'
complete -x -c phpunit -s c -l configuration -k -a '(__fish_complete_suffix .xml .xml.dist)' -d 'Read configuration from XML file'
complete -x -c phpunit -s c -l configuration -k -a '(__fish_complete_suffix .xml; __fish_complete_suffix .xml.dist)' -d 'Read configuration from XML file'
complete -f -c phpunit -l no-configuration -d 'Ignore default configuration file (phpunit.xml)'
complete -f -c phpunit -l no-logging -d 'Ignore logging configuration'
complete -f -c phpunit -l no-extensions -d 'Do not load PHPUnit extensions'

View File

@@ -22,7 +22,6 @@ complete -c rsync -s q -l quiet -d "Suppress non-error messages"
complete -c rsync -l no-motd -d "Suppress daemon-mode MOTD"
complete -c rsync -s c -l checksum -d "Skip based on checksum, not mod-time & size"
complete -c rsync -s a -l archive -d "Archive mode; same as -rlptgoD (no -H)"
complete -c rsync -l no-OPTION -d "Turn off an implied OPTION (e.g. --no-D)"
complete -c rsync -s r -l recursive -d "Recurse into directories"
complete -c rsync -s R -l relative -d "Use relative path names"
complete -c rsync -l no-implied-dirs -d "Dont send implied dirs with --relative"

View File

@@ -1,30 +1,23 @@
#
# Command specific completions for the scons command.
# These completions where generated from the commands
# man page by the make_completions.py script, but may
# have been hand edited since.
#
complete -c scons -s c -l clean -l remove -d 'Clean up by removing all target files for which a construction command is specified'
complete -c scons -s c -l clean -l remove -d 'Clean up all target files'
complete -c scons -l cache-debug -d 'Print debug information about the CacheDir() derived-file caching to the specified file'
complete -c scons -l cache-disable -l no-cache -d 'Disable the derived-file caching specified by CacheDir()'
complete -c scons -l cache-force -l cache-populate -d 'When using CacheDir(), populate a cache by copying any already- existing, up-to-date derived files to the cache, in addition to files built by this invocation'
complete -c scons -l cache-show -d 'When using CacheDir() and retrieving a derived file from the cache, show the command that would have been executed to build the file, instead of the usual report, "Retrieved file from cache'
complete -c scons -l cache-force -l cache-populate -d 'Populate cache with already existing files'
complete -c scons -l cache-show -d 'Show how a cached file would be built'
complete -c scons -l config -d 'This specifies how the Configure call should use or generate the results of configuration tests' -a '
complete -c scons -l config -d 'How the Configure call should run the config tests' -a '
auto\t"Use normal dependency mechanism"
force\t"Rerun all tests"
cache\t"Take all results from cache"' -x
complete -c scons -s C -d 'Directory, --directory=directory Change to the specified directory before searching for the SCon struct, Sconstruct, or sconstruct file, or doing anything else'
complete -c scons -s D -d 'Works exactly the same way as the -u option except for the way default targets are handled'
complete -c scons -s C -l directory -d 'Change to this directory before searching for the sconstruct file'
complete -c scons -s D -d 'Like -u except for the way default targets are handled'
complete -c scons -l debug -d 'Debug the build process' -a "count dtree explain findlibs includes memoizer memory nomemoizer objects pdb presub stacktrace stree time tree" -x
complete -c scons -l diskcheck -d 'Enable specific checks for whether or not there is a file on disk where the SCons configuration expects a directory (or vice versa), and whether or not RCS or SCCS sources exist when searching for source and include files' -a "all none match rcs " -x
complete -c scons -l diskcheck -d 'Check if files and directories are where they should be' -a "all none match rcs " -x
complete -c scons -s f -l file -l makefile -l sconstruct -d 'Use file as the initial SConscript file'
complete -c scons -s h -l help -d 'Print a local help message for this build, if one is defined in the SConscript file(s), plus a line that describes the -H option for command-line option help'
complete -c scons -s h -l help -d 'Print a help message for this build'
complete -c scons -s H -l help-options -d 'Print the standard help message about command-line options and exit'
complete -c scons -s i -l ignore-errors -d 'Ignore all errors from commands executed to rebuild files'
complete -c scons -s I -l include-dir -d 'Specifies a directory to search for imported Python modules'
@@ -41,13 +34,13 @@ complete -c scons -s q -l question -d 'Do not run any commands, or print anythin
complete -c scons -s Q -d 'Quiets SCons status messages about reading SConscript files, building targets and entering directories'
complete -c scons -l random -d 'Build dependencies in a random order'
complete -c scons -s s -l silent -l quiet -d Silent
complete -c scons -l taskmastertrace -d 'Prints trace information to the specified file about how the internal Taskmaster object evaluates and controls the order in which Nodes are built'
complete -c scons -s u -l up -l search-up -d 'Walks up the directory structure until an SConstruct , Scon struct or sconstruct file is found, and uses that as the top of the directory tree'
complete -c scons -s U -d 'Works exactly the same way as the -u option except for the way default targets are handled'
complete -c scons -s v -l version -d 'Print the scons version, copyright information, list of authors, and any other relevant information'
complete -c scons -s w -l print-directory -d 'Print a message containing the working directory before and after other processing'
complete -c scons -l taskmastertrace -d 'Prints Taskmaster trace information to the specified file'
complete -c scons -s u -l up -l search-up -d 'Walks up directories for an SConstruct file, and uses that as the top of the directory tree'
complete -c scons -s U -d 'Like -u option except for how default targets are handled'
complete -c scons -s v -l version -d 'Print the scons version information'
complete -c scons -s w -l print-directory -d 'Print the working directory'
complete -c scons -l warn -d 'Enable or disable warnings' -a 'all no-all dependency no-dependency deprecated no-deprecated missing-sconscript no-missing-sconscript' -x
complete -c scons -l no-print-directory -d 'Turn off -w, even if it was turned on implicitly'
complete -c scons -s Y -l repository -d 'Search the specified repository for any input and target files not found in the local directory hierarchy'
complete -c scons -s Y -l repository -d 'Search this repo for input and target files not in the local directory tree'

View File

@@ -1,23 +0,0 @@
# Completions for the scrypt encryption utility
complete -x -c scrypt -n __fish_use_subcommand -a enc -d "Encrypt file"
complete -x -c scrypt -n __fish_use_subcommand -a dec -d "Decrypt file"
complete -x -c scrypt -n __fish_use_subcommand -a info -d "Print information about the encryption parameters"
complete -c scrypt -n "__fish_seen_subcommand_from enc dec" -s f -d "Force the operation to proceed"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -l logN -a "(seq 10 40)" -d "Set the work parameter N"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s M -d "Use at most the specified bytes of RAM"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s m -d "Use at most the specified fraction of the available RAM"
complete -c scrypt -n "__fish_seen_subcommand_from enc dec" -s P -d "Deprecated synonym for `--passphrase dev:stdin-once`"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s p -a "(seq 1 32)" -d "Set the work parameter p"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -l passphrase -a "
dev:tty-stdin\t'Read from /dev/tty, or stdin if fails (default)'
dev:stdin-once\t'Read from stdin'
dev:tty-once\t'Read from /dev/tty'
env:(set -xn)\t'Read from the environment variable'
file:(__fish_complete_path)\t'Read from the file'
" -d "Read the passphrase using the specified method"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s r -a "(seq 1 32)" -d "Set the work parameter r"
complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s t -d "Use at most the specified seconds of CPU time"
complete -c scrypt -n "__fish_seen_subcommand_from enc dec" -s v -d "Print encryption parameters and memory/CPU limits"
complete -x -c scrypt -n "not __fish_seen_subcommand_from enc dec info" -l version -d "Print version"

View File

@@ -624,7 +624,7 @@ complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s b -l pub
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s k -l installationkey -d 'installation key for key-protected package (default: null)'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s p -l package -d 'ID (starts with 04t) or alias of the package version to install'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s r -l noprompt -d 'do not prompt for confirmation'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s s -l securitytype -d '[default: AllUsers] security access type for the installed package (deprecation notice: The default --securitytype value will change from AllUsers to AdminsOnly in v47.0 or later.)' -xa 'AllUsers AdminsOnly'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s s -l securitytype -d '[default: AllUsers] security access type for the installed package' -xa 'AllUsers AdminsOnly'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s t -l upgradetype -d '[default: Mixed] the upgrade type for the package installation' -xa 'DeprecateOnly Mixed Delete'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s u -l targetusername -d 'username or alias for the target org; overrides default target org'
complete -c sfdx -n '__fish_sfdx_using_command force:package:create' -s w -l wait -d 'number of minutes to wait for installation status'
@@ -688,7 +688,7 @@ complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s b -l pu
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s k -l installationkey -d 'installation key for key-protected package (default: null)'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s p -l package -d 'ID (starts with 04t) or alias of the package version to install'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s r -l noprompt -d 'do not prompt for confirmation'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s s -l securitytype -d '[default: AllUsers] security access type for the installed package (deprecation notice: The default --securitytype value will change from AllUsers to AdminsOnly in v47.0 or later.)' -xa 'AllUsers AdminsOnly'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s s -l securitytype -d '[default: AllUsers] security access type for the installed package' -xa 'AllUsers AdminsOnly'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s t -l upgradetype -d '[default: Mixed] the upgrade type for the package installation' -xa 'DeprecateOnly Mixed Delete'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s u -l targetusername -d 'username or alias for the target org; overrides default target org'
complete -c sfdx -n '__fish_sfdx_using_command force:package:install' -s w -l wait -d 'number of minutes to wait for installation status'

View File

@@ -5,7 +5,7 @@
# imagine my surprise when I found fish function stirngs in binaries in /usr/bin!
# checking the path is as expected is about as far as we're going with validation
if test (command -v shortcuts) = /usr/bin/shortcuts
if test "$(command -s shortcuts)" = /usr/bin/shortcuts
command shortcuts --generate-completion-script=fish | source
end

View File

@@ -1,108 +0,0 @@
# Commands
complete -c ssh-copy-id -d Remote -xa "(__fish_complete_user_at_hosts)"
complete -c ssh-copy-id -d Remote -k -fa '(__ssh_history_completions)'
# Options
complete -c ssh-copy-id -s i -d IdentityFile -r -F
complete -c ssh-copy-id -s p -d Port -r -x
complete -c ssh-copy-id -s F -d 'Alternate ssh config file' -r -F
# Load completions shared by various ssh tools like ssh, scp and sftp.
complete -c ssh-copy-id -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 ssh-copy-id -s f -d 'Force mode'
complete -c ssh-copy-id -s n -d 'Dry run'
complete -c ssh-copy-id -s s -d 'Use sftp'
complete -c ssh-copy-id -s h -s \? -d 'Show help'

View File

@@ -5,6 +5,11 @@ __fish_complete_ssh ssh
# ssh specific completions
#
# Also retrieve `user@host` entries from history
function __ssh_history_completions
history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1'
end
complete -c ssh -d Remote -xa "(__fish_complete_user_at_hosts)"
complete -c ssh -d Remote -k -fa '(__ssh_history_completions)'

View File

@@ -1,6 +1,8 @@
complete -c tex -o help -d "Display help and exit"
complete -c tex -o version -d "Display version and exit"
complete -c tex -k -x -a "(__fish_complete_suffix --description='(La)TeX file' .tex)"
complete -c tex -k -x -a "(
__fish_complete_suffix (commandline -ct) .tex '(La)TeX file'
)"
complete -c tex -o file-line-error -d "Show errors in style file:line"
complete -c tex -o no-file-line-error -d "Show errors not in style file:line"

View File

@@ -7,7 +7,7 @@ if command tr --version >/dev/null 2>/dev/null
complete -c tr -x
complete -c tr -s c -s C -l complement -d 'use the complement of SET1'
complete -c tr -s d -l delete -d 'delete characters in SET1, do not translate'
complete -c tr -s s -l squeeze-repeats -d 'replace each input sequence of a repeated character that is listed in SET1 with a single occurrence of that character'
complete -c tr -s s -l squeeze-repeats -d 'replace each run of a character listed in SET1 with a single occurrence of that character'
complete -c tr -s t -l truncate-set1 -d 'first truncate SET1 to length of SET2'
complete -c tr -l help -d 'display this help and exit'
complete -c tr -l version -d 'output version information and exit'
@@ -27,10 +27,10 @@ if command tr --version >/dev/null 2>/dev/null
else
# If not a GNU system, assume we have standard BSD tr features instead
complete -c tr -x
complete -c tr -s C -d 'Complement the set of characters in string1.'
complete -c tr -s c -d 'Same as -C but complement the set of values in string1.'
complete -c tr -s d -d 'Delete characters in string1 from the input.'
complete -c tr -s s -d 'Squeeze multiple occurrences of the characters listed in the last operand (either string1 or string2) in the input into a single instance of the character.'
complete -c tr -s C -d 'Complement the set of characters in string1'
complete -c tr -s c -d 'Same as -C but complement the set of values in string1'
complete -c tr -s d -d 'Delete characters in string1 from the input'
complete -c tr -s s -d 'Squeeze runs of characters listed in the last operand into one'
complete -c tr -l u -d 'Guarantee that any output is unbuffered.'
complete -c tr -a '[:alnum:]' -d 'alphanumeric characters'

View File

@@ -8,14 +8,14 @@ set -l formats raw row bitwise extfile
set -l line_endings LF CR CRLF
set -l woff_fmts woff woff2
complete -f -c ttx -k -a '(__fish_complete_suffix .otf .ttf .ttx .ttc)'
complete -c ttx -f -n "__fish_is_nth_token 1" -k -a '(__fish_complete_suffix .otf .ttf .ttx)'
complete -f -c ttx -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx; __fish_complete_suffix .ttc)'
complete -c ttx -f -n "__fish_is_nth_token 1" -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx)'
# General options
complete -c ttx -f -s h -d'Show help message'
complete -c ttx -f -l version -d'Show version info'
complete -c ttx -x -s d -d'Set output folder' -a '(__fish_complete_directories)'
complete -c ttx -r -s o -d'Set output filename' -k -a '(__fish_complete_suffix .otf .ttf .ttx)'
complete -c ttx -r -s o -d'Set output filename' -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf; __fish_complete_suffix .ttx)'
complete -c ttx -f -s f -d'Force output overwrite'
complete -c ttx -f -s v -d'Verbose output'
complete -c ttx -f -s q -d'Quiet mode'
@@ -35,7 +35,7 @@ complete -c ttx -x -l unicodedata -d'Custom database for character names [Unicod
complete -c ttx -x -l newline -d'Set EOL format' -a "$line_endings"
# Compile options
complete -c ttx -x -s m -d'Merge named TTF/OTF with SINGLE .ttx input' -k -a '(__fish_complete_suffix .otf .ttf)'
complete -c ttx -x -s m -d'Merge named TTF/OTF with SINGLE .ttx input' -k -a '(__fish_complete_suffix .otf; __fish_complete_suffix .ttf)'
complete -c ttx -f -s b -d'Don\'t recalculate glyph bounding boxes'
complete -c ttx -f -l recalc-timestamp -d'Set font modified timestamp to current time'
complete -c ttx -x -l flavor -d'Set WOFF flavor' -a "$woff_fmts"

View File

@@ -28,7 +28,11 @@ complete -c unzip -s M -d "pipe through `more` pager"
if unzip -v 2>/dev/null | string match -eq Debian
# the first non-switch argument should be the zipfile
complete -c unzip -n "__fish_is_nth_token 1" -k -xa '(__fish_complete_suffix .zip .jar .aar)'
complete -c unzip -n "__fish_is_nth_token 1" -k -xa '(
__fish_complete_suffix .zip
__fish_complete_suffix .jar
__fish_complete_suffix .aar
)'
# Files thereafter are either files to include or exclude from the operation
set -l zipfile
@@ -37,6 +41,10 @@ if unzip -v 2>/dev/null | string match -eq Debian
else
# all tokens should be zip files
complete -c unzip -k -xa '(__fish_complete_suffix .zip .jar .aar)'
complete -c unzip -k -xa '(
__fish_complete_suffix .zip
__fish_complete_suffix .jar
__fish_complete_suffix .aar
)'
end

View File

@@ -68,5 +68,6 @@ complete -c $progname -s S -d 'Shows information of an installed package' -x
complete -c $progname -s s -d 'Search for packages by matching PATTERN on pkgver or short_desc'
complete -c $progname -s f -d 'Show the package files for PKG' -x
complete -c $progname -s x -d 'Show the required dependencies for PKG. Only direct dependencies are shown' -x
complete -c $progname -s X -d 'Show the reverse dependencies for PKG' -x
complete -c $progname -s X -d 'Show the reverse dependencies for PKG' -xa "$listinstalled"
complete -c $progname -s X -d 'Show the reverse dependencies for PKG' -x -n "__fish_contains_opt -s R" -a "$listall"
complete -c $progname -l cat -d 'Prints the file FILE stored in binary package PKG to stdout' -F

View File

@@ -1,5 +1,12 @@
complete -c xz -s z -l compress -d Compress
complete -c xz -s d -l decompress -l uncompress -d Decompress -k -x -a "(__fish_complete_suffix .xz .txz .lzma .tlz)"
complete -c xz -s d -l decompress -l uncompress -d Decompress -k -x -a "
(
__fish_complete_suffix .xz
__fish_complete_suffix .txz
__fish_complete_suffix .lzma
__fish_complete_suffix .tlz
)
"
complete -c xz -s t -l test -d 'Test the integrity of compressed files'
complete -c xz -s l -l list -d 'Print information about compressed files'

View File

@@ -170,7 +170,7 @@ complete -c $progname -n "$files" -l machinereadable -d 'Show in machine readabl
# Upgrade options
# Theoretically, pacman reads packages in all formats that libarchive supports
# In practice, it's going to be tar.xz, tar.gz or tar.zst
complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst pkg.tar.xz pkg.tar.gz)' -d 'Package file'
complete -c $progname -n "$upgrade" -k -xa '(__fish_complete_suffix pkg.tar.zst; __fish_complete_suffix pkg.tar.xz; __fish_complete_suffix pkg.tar.gz)' -d 'Package file'
## Yaourt only stuff
# Clean options

View File

@@ -1,4 +1,8 @@
complete -c zcat -k -x -a "(__fish_complete_suffix .gz .tgz)"
complete -c zcat -k -x -a "(
__fish_complete_suffix .gz
__fish_complete_suffix .tgz
)
"
complete -c zcat -s f -l force -d Overwrite
complete -c zcat -s h -l help -d "Display help and exit"
complete -c zcat -s L -l license -d "Print license"

View File

@@ -230,8 +230,12 @@ function fg
builtin fg (__fish_expand_pid_args $argv)[-1]
end
function kill
command kill (__fish_expand_pid_args $argv)
if command -q kill
# Only define this if something to wrap exists
# this allows a nice "commad not found" error to be triggered.
function kill
command kill (__fish_expand_pid_args $argv)
end
end
# As last part of initialization, source the conf directories.

View File

@@ -1,5 +1,10 @@
function __fish_complete_docutils -d "Completions for Docutils common options" -a cmd
complete -x -c $cmd -k -a "(__fish_complete_suffix .rst .txt)"
complete -x -c $cmd -k -a "
(
__fish_complete_suffix .rst
__fish_complete_suffix .txt
)
"
# General Docutils Options
complete -c $cmd -l title -d "Specify the docs title"

View File

@@ -1,52 +1,79 @@
# Find files ending in any of the non-switch arguments and output them as completions.
# * --description provides the description that should be part of each generated completion,
# * --prefix=DIR makes __fish_complete_suffix behave as if it were called in DIR rather than $PWD
# * --complete=PREFIX only lists files that begin with PREFIX
#
# Files matching the above preconditions are printed first then other, non-matching files
# are printed for fallback purposes. As such, it is imperative that `complete` calls that
# shell out to `__fish_complete_suffix` are made with a `-k` switch to ensure sort order
# is preserved.
# Find files that complete $argv[1], has the suffix $argv[2], and output them
# as completions with the optional description $argv[3]. Then, also output
# completions for the files that don't have the suffix, so you want to use
# "complete -k" on the output. Both $argv[1] and $argv[3] are optional,
# if only one is specified, it is assumed to be the argument to complete. If
# $argv[4] is present, it is treated as a prefix for the path, i.e. in lieu
# of $PWD.
function __fish_complete_suffix -d "Complete using files"
set -l _flag_prefix ""
set -l _flag_complete (commandline -ct)
argparse 'prefix=' 'description=' 'complete=' -- $argv
# Variable declarations
set -l suff (string escape --style=regex -- $argv)
set -l comp
set -l suff
set -l desc
set -l files
set -l prefix ""
switch (count $argv)
case 1
set comp (commandline -ct)
set suff $argv
set desc ""
case 2
set comp $argv[1]
set suff $argv[2]
set desc ""
case 3
set comp $argv[1]
set suff $argv[2]
set desc $argv[3]
case 4
set comp $argv[1]
set suff $argv[2]
set desc $argv[3]
set prefix $argv[4]
# Only directories are supported as prefixes, and to use the same logic
# for both absolute prefixed paths and relative non-prefixed paths, $prefix
# must terminate in a `/` if it is present, so it can be unconditionally
# prefixed to any path to get the desired result.
if not string match -qr '/$' $prefix
set prefix $prefix/
end
end
# Simple and common case: no prefix, just complete normally and sort matching files first.
if test -z $_flag_prefix
if test -z $prefix
set -l suffix (string escape --style=regex -- $suff)
# Use normal file completions.
set files (complete -C "__fish_command_without_completions $_flag_complete")
set -l files_with_suffix (string match -r -- (string join "|" "^.*"$suff\$) $files)
set files (complete -C "__fish_command_without_completions $comp")
set -l files_with_suffix (string match -r -- "^.*$suffix\$" $files)
set -l directories (string match -r -- '^.*/$' $files)
set files $files_with_suffix $directories $files
else
# Only directories are supported as prefixes, and to use the same logic
# for both absolute prefixed paths and relative non-prefixed paths, $_flag_prefix
# must terminate in a `/` if it is present, so it can be unconditionally
# prefixed to any path to get the desired result.
if not string match -qr '/$' $_flag_prefix
set _flag_prefix $_flag_prefix/
end
# Strip leading ./ as it confuses the detection of base and suffix
# It is conditionally re-added below.
set base $_flag_prefix(string replace -r '^("\')?\\./' '' -- $_flag_complete | string trim -c '\'"') # " make emacs syntax highlighting happy
set base $prefix(string replace -r '^("\')?\\./' '' -- $comp | string trim -c '\'"') # " make emacs syntax highlighting happy
set -l all
set -l files_with_suffix
set -l dirs
# If $_flag_complete is "./ma" and the file is "main.py", we'll catch that case here,
# If $comp is "./ma" and the file is "main.py", we'll catch that case here,
# but complete.cpp will not consider it a match, so we have to output the
# correct form.
# Also do directory completion, since there might be files with the correct
# suffix in a subdirectory.
set all $base*
set files_with_suffix (string match -r -- (string join "|" ".*"$suff) $all)
if not string match -qr '/$' -- $argv
set files_with_suffix (string match -r -- ".*"(string escape --style=regex -- $suff) $all)
if not string match -qr '/$' -- $suff
set dirs $base*/
# The problem is that we now have each directory included twice in the output,
@@ -61,7 +88,7 @@ function __fish_complete_suffix -d "Complete using files"
end
set files $files_with_suffix $dirs $all
if string match -qr '^\\./' -- $_flag_complete
if string match -qr '^\\./' -- $comp
set files ./$files
else
# "Escape" files starting with a literal dash `-` with a `./`
@@ -70,14 +97,14 @@ function __fish_complete_suffix -d "Complete using files"
end
if set -q files[1]
if string match -qr -- . "$_flag_description"
set _flag_description "\t$_flag_description"
if string match -qr -- . "$desc"
set desc "\t$desc"
end
if string match -qr -- . "$_flag_prefix"
set prefix (string escape --style=regex -- $_flag_prefix)
if string match -qr -- . "$prefix"
set prefix (string escape --style=regex -- $prefix)
set files (string replace -r -- "^$prefix" "" $files)
end
printf "%s$_flag_description\n" $files
printf "%s$desc\n" $files
end
end

View File

@@ -1,4 +1,6 @@
function __fish_is_zfs_feature_enabled -a feature target -d "Returns 0 if the given ZFS feature is available or enabled for the given full-path target (zpool or dataset), or any target if none given"
type -q zpool
or return
set -l pool (string replace -r '/.*' '' -- $target)
set -l feature_name ""
if test -z "$pool"
@@ -9,7 +11,6 @@ function __fish_is_zfs_feature_enabled -a feature target -d "Returns 0 if the gi
if test $status -ne 0 # No such feature
return 1
end
echo $feature_name | read -l _ _ state _
set -l state (echo $feature_name | cut -f3)
string match -qr '(active|enabled)' -- $state
return $status

View File

@@ -19,6 +19,12 @@ function __fish_make_completion_signals --description 'Make list of kill signals
return
end
# If we don't have a kill, we don't try to run it.
# We require a kill *command* because we used to unconditionally define
# a wrapper (to allow %foo expansion)
command -q kill
or return
# Some systems use the GNU coreutils kill command where `kill -L` produces an extended table
# format that looks like this:
#

View File

@@ -16,7 +16,7 @@ function __fish_man_page
# If there are at least two tokens not starting with "-", the second one might be a subcommand.
# Try "man first-second" and fall back to "man first" if that doesn't work out.
set -l maincmd (basename $args[1])
set -l maincmd (path basename $args[1])
# 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,

View File

@@ -7,32 +7,53 @@ function __fish_print_apt_packages
return
end
type -q -f apt-cache || return 1
set -l search_term (commandline -ct | string replace -ar '[\'"\\\\]' '' | string lower)
if ! test -f /var/lib/dpkg/status
return 1
end
# Do not not use `apt-cache` as it is sometimes inexplicably slow (by multiple orders of magnitude).
if not set -q _flag_installed
# Do not generate the cache as apparently sometimes this is slow.
# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547550
# (It is safe to use `sed -r` here as we are guaranteed to be on a GNU platform
# if apt-cache was found.)
# Uses the UTF-8/ASCII record separator (0x1A) character.
#
# Note: This can include "Description:" fields which we need to include,
# "Description-en_GB" (or another locale code) fields which we need to include
# as well as "Description-md5" fields which we absolutely do *not* want to include
# The regex doesn't allow numbers, so unless someone makes a hash algorithm without a number
# in the name, we're safe. (yes, this should absolutely have a better format).
#
# aptitude has options that control the output formatting, but is orders of magnitude slower
#
# sed could probably do all of the heavy lifting here, but would be even less readable
#
# The `head -n 500` causes us to stop once we have 500 lines. We do it after the `sed` because
# Debian package descriptions can be extremely long and are hard-wrapped: texlive-latex-extra
# has about 2700 lines on Debian 11.
apt-cache --no-generate show '.*'(commandline -ct)'.*' 2>/dev/null | sed -r '/^(Package|Description-?[a-zA-Z_]*):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\x1a\n/g' | head -n 500 | string join "" | string replace --all --regex \x1a+ \n | uniq
return 0
awk -e '
BEGIN {
FS=": "
}
/^Package/ {
pkg=$2
}
/^Description(-[a-zA-Z]+)?:/ {
desc=$2
if (index(pkg, "'$search_term'") > 0) {
print pkg "\t" desc
}
pkg="" # Prevent multiple description translations from being printed
}' < /var/lib/dpkg/status
else
set -l packages (dpkg --get-selections | string replace -fr '(\S+)\s+install' "\$1" | string match -e (commandline -ct))
apt-cache --no-generate show $packages 2>/dev/null | sed -r '/^(Package|Description-?[a-zA-Z_]*):/!d;s/Package: (.*)/\1\t/g;s/Description-?[^:]*: (.*)/\1\x1a\n/g' | head -n 500 | string join "" | string replace --all --regex \x1a+ \n | uniq
return 0
awk -e '
BEGIN {
FS=": "
}
/^Package/ {
pkg=$2
}
/^Status/ {
installed=0
if ($2 ~ /(^|\s)installed/) {
installed=1
}
}
/^Description(-[a-zA-Z]+)?:/ {
desc=$2
if (installed == 1 && index(pkg, "'$search_term'") > 0) {
print pkg "\t" desc
installed=0 # Prevent multiple description translations from being printed
}
}' < /var/lib/dpkg/status
end
end

View File

@@ -19,7 +19,7 @@ function __fish_print_xbps_packages
end
end
# prints: <package name> Package
xbps-query -Rs "" | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' | tee $cache_file
xbps-query -Rsl | sed 's/^... \([^ ]*\)-.* .*/\1/; s/$/\t'Package'/' | tee $cache_file
return 0
else
xbps-query -l | sed 's/^.. \([^ ]*\)-.* .*/\1/' # TODO: actually put package versions in tab for locally installed packages

View File

@@ -98,7 +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
bind --preset $argv \es 'for cmd in sudo doas please; if command -q $cmd; fish_commandline_prepend $cmd; break; end; end'
bind --preset $argv \es "if command -q sudo; fish_commandline_prepend sudo; else if command -q doas; fish_commandline_prepend doas; end"
# Allow reading manpages by pressing F1 (many GUI applications) or Alt+h (like in zsh).
bind --preset $argv -k f1 __fish_man_page
@@ -216,10 +216,12 @@ function __fish_start_bracketed_paste
# we escape single-quotes (and backslashes).
string match -q 'single*' (__fish_tokenizer_state -- (commandline -ct | string collect))
and set -g __fish_paste_quoted 1
commandline -f begin-undo-group
end
function __fish_stop_bracketed_paste
# Restore the last bind mode.
set fish_bind_mode $__fish_last_bind_mode
set -e __fish_paste_quoted
commandline -f end-undo-group
end

View File

@@ -1,3 +0,0 @@
function __ssh_history_completions -d "Retrieve `user@host` entries from history"
history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1'
end

View File

@@ -0,0 +1,113 @@
function fish_fossil_prompt --description 'Write out the fossil prompt'
# Bail if fossil is not available
if not command -sq fossil
return 1
end
# Read branch and bookmark (bail if not checkout)
set -l branch (fossil branch current 2>/dev/null)
or return 127
set -q fish_color_fossil_clean
or set -g fish_color_fossil_clean green
set -q fish_color_fossil_modified
or set -g fish_color_fossil_modified yellow
set -q fish_color_fossil_dirty
or set -g fish_color_fossil_dirty red
set -q fish_color_fossil_added
or set -g fish_color_fossil_added green
set -q fish_color_fossil_renamed
or set -g fish_color_fossil_renamed magenta
set -q fish_color_fossil_missing
or set -g fish_color_fossil_missing red
set -q fish_color_fossil_deleted
or set -g fish_color_fossil_deleted red
set -q fish_color_fossil_untracked
or set -g fish_color_fossil_untracked yellow
set -q fish_color_fossil_conflict
or set -g fish_color_fossil_conflict red
set -q fish_prompt_fossil_status_added
or set -g fish_prompt_fossil_status_added '✚'
set -q fish_prompt_fossil_status_modified
or set -g fish_prompt_fossil_status_modified '*'
set -q fish_prompt_fossil_status_renamed
or set -g fish_prompt_fossil_status_renamed '⇒'
set -q fish_prompt_fossil_status_deleted
or set -g fish_prompt_fossil_status_deleted '-'
set -q fish_prompt_fossil_status_missing
or set -g fish_prompt_fossil_status_missing '✖'
set -q fish_prompt_fossil_status_untracked
or set -g fish_prompt_fossil_status_untracked '?'
set -q fish_prompt_fossil_status_conflict
or set -g fish_prompt_fossil_status_conflict '×'
set -q fish_prompt_fossil_status_order
or set -g fish_prompt_fossil_status_order added modified renamed deleted missing untracked conflict
echo -n ' ('
set_color magenta
echo -n "$branch"
set_color normal
echo -n '|'
#set -l repo_status (fossil changes --differ 2>/dev/null | string match -rv '\w:|^\s' | string split " " -f1 | sort -u)
set -l repo_status (fossil changes --differ 2>/dev/null | string match -rv '\w:|^\s' | string split " " -f1 | path sort -u)
# Show nice color for a clean repo
if test -z "$repo_status"
set_color $fish_color_fossil_clean
echo -n '✔'
# Handle modified or dirty (unknown state)
else
set -l fossil_statuses
# Take actions for the statuses of the files in the repo
for line in $repo_status
# Add a character for each file status if we have one
switch $line
case 'ADDED'
set -a fossil_statuses added
case 'EDITED'
set -a fossil_statuses modified
case 'EXTRA'
set -a fossil_statuses untracked
case 'DELETED'
set -a fossil_statuses deleted
case 'MISSING'
set -a fossil_statuses missing
case 'RENAMED'
set -a fossil_statuses renamed
case 'CONFLICT'
set -a fossil_statuses conflict
end
end
if string match -qr '^(ADDED|EDITED|DELETED)' $repo_status
set_color $fish_color_fossil_modified
else
set_color --bold $fish_color_fossil_dirty
end
echo -n '⚡'
set_color normal
# Sort status symbols
for i in $fish_prompt_fossil_status_order
if contains -- $i $fossil_statuses
set -l color_name fish_color_fossil_$i
set -l status_name fish_prompt_fossil_status_$i
set_color $$color_name
echo -n $$status_name
end
end
end
set_color normal
echo -n ')'
end

View File

@@ -3,6 +3,7 @@ function fish_vcs_prompt --description "Print all vcs prompts"
# This is so we don't try svn if git already worked.
fish_git_prompt $argv
or fish_hg_prompt $argv
or fish_fossil_prompt $argv
# The svn prompt is disabled by default because it's quite slow on common svn repositories.
# To enable it uncomment it.
# You can also only use it in specific directories by checking $PWD.

View File

@@ -157,7 +157,7 @@ function funced --description 'Edit function definition'
source "$writepath"
else
echo (_ "Saving to original location failed; saving to user configuration instead.")
set writepath $__fish_config_dir/functions/(basename "$writepath")
set writepath $__fish_config_dir/functions/(path basename "$writepath")
if cp $tmpname "$writepath"
printf (_ "Function saved to %s") "$writepath"
echo

View File

@@ -76,7 +76,7 @@ function fish_prompt
set arrow "$arrow_color# "
end
set -l cwd $cyan(basename (prompt_pwd))
set -l cwd $cyan(prompt_pwd | path basename)
set -l repo_info
if set -l repo_type (_repo_type)

View File

@@ -3,7 +3,7 @@
function fish_prompt
set_color $fish_color_cwd
echo -n (basename $PWD)
echo -n (path basename $PWD)
set_color normal
echo -n ' ) '
end

View File

@@ -109,7 +109,7 @@ function fish_prompt
set -q VIRTUAL_ENV_DISABLE_PROMPT
or set -g VIRTUAL_ENV_DISABLE_PROMPT true
set -q VIRTUAL_ENV
and _nim_prompt_wrapper $retc V (basename "$VIRTUAL_ENV")
and _nim_prompt_wrapper $retc V (path basename "$VIRTUAL_ENV")
# git
set -l prompt_git (fish_git_prompt '%s')

View File

@@ -23,7 +23,7 @@ function fish_prompt
# Line 2
echo
if test -n "$VIRTUAL_ENV"
printf "(%s) " (set_color blue)(basename $VIRTUAL_ENV)(set_color normal)
printf "(%s) " (set_color blue)(path basename $VIRTUAL_ENV)(set_color normal)
end
printf '↪ '
set_color normal

View File

@@ -135,6 +135,9 @@ static int report_function_metadata(const wcstring &funcname, bool verbose, io_s
const wchar_t *shadows_scope = L"n/a";
wcstring description = L"n/a";
int line_number = 0;
bool is_copy = false;
wcstring copy_path = L"n/a";
int copy_line_number = 0;
if (auto props = function_get_props_autoload(funcname, parser)) {
if (props->definition_file) {
@@ -144,6 +147,16 @@ static int report_function_metadata(const wcstring &funcname, bool verbose, io_s
} else {
path = L"stdin";
}
is_copy = props->is_copy;
if (props->copy_definition_file) {
copy_path = *props->copy_definition_file;
copy_line_number = props->copy_definition_lineno;
} else {
copy_path = L"stdin";
}
shadows_scope = props->shadow_scope ? L"scope-shadowing" : L"no-scope-shadowing";
description = escape_string(props->description, ESCAPE_NO_PRINTABLES | ESCAPE_NO_QUOTED);
}
@@ -152,12 +165,26 @@ static int report_function_metadata(const wcstring &funcname, bool verbose, io_s
// "stdin" means it was defined interactively, "-" means it was defined via `source`.
// Neither is useful information.
wcstring comment;
if (path == L"stdin") {
append_format(comment, L"# Defined interactively\n");
append_format(comment, L"# Defined interactively");
} else if (path == L"-") {
append_format(comment, L"# Defined via `source`\n");
append_format(comment, L"# Defined via `source`");
} else {
append_format(comment, L"# Defined in %ls @ line %d\n", path.c_str(), line_number);
append_format(comment, L"# Defined in %ls @ line %d", path.c_str(), line_number);
}
if (is_copy) {
if (copy_path == L"stdin") {
append_format(comment, L", copied interactively\n");
} else if (copy_path == L"-") {
append_format(comment, L", copied via `source`\n");
} else {
append_format(comment, L", copied in %ls @ line %d\n", copy_path.c_str(),
copy_line_number);
}
} else {
append_format(comment, L"\n");
}
if (!streams.out_is_redirected && isatty(STDOUT_FILENO)) {
@@ -168,9 +195,10 @@ static int report_function_metadata(const wcstring &funcname, bool verbose, io_s
streams.out.append(comment);
}
} else {
streams.out.append_format(L"%ls\n", path.c_str());
streams.out.append_format(L"%ls\n", is_copy ? copy_path.c_str() : path.c_str());
if (verbose) {
streams.out.append_format(L"%ls\n", autoloaded);
streams.out.append_format(L"%ls\n", is_copy ? path.c_str() : autoloaded);
streams.out.append_format(L"%d\n", line_number);
streams.out.append_format(L"%ls\n", shadows_scope);
streams.out.append_format(L"%ls\n", description.c_str());
@@ -331,7 +359,7 @@ maybe_t<int> builtin_functions(parser_t &parser, io_streams_t &streams, const wc
return STATUS_CMD_ERROR;
}
if (function_copy(current_func, new_func)) return STATUS_CMD_OK;
if (function_copy(current_func, new_func, parser)) return STATUS_CMD_OK;
return STATUS_CMD_ERROR;
}

View File

@@ -90,7 +90,7 @@ static void print_colors(io_streams_t &streams, wcstring_list_t args, bool bold,
streams.out.append(str2wcstring(outp.contents()));
}
static const wchar_t *const short_options = L":b:hoidrcu";
static const wchar_t *const short_options = L":b:hvoidrcu";
static const struct woption long_options[] = {{L"background", required_argument, 'b'},
{L"help", no_argument, 'h'},
{L"bold", no_argument, 'o'},
@@ -98,6 +98,7 @@ static const struct woption long_options[] = {{L"background", required_argument,
{L"italics", no_argument, 'i'},
{L"dim", no_argument, 'd'},
{L"reverse", no_argument, 'r'},
{L"version", no_argument, 'v'},
{L"print-colors", no_argument, 'c'},
{}};

View File

@@ -133,32 +133,44 @@ maybe_t<int> builtin_type(parser_t &parser, io_streams_t &streams, const wchar_t
res = true;
if (!opts.query && !opts.type) {
auto path = func->definition_file;
auto copy_path = func->copy_definition_file;
auto final_path = func->is_copy ? copy_path : path;
wcstring comment;
if (!path) {
append_format(comment, _(L"Defined interactively"));
} else if (*path == L"-") {
append_format(comment, _(L"Defined via `source`"));
} else {
append_format(comment, _(L"Defined in %ls @ line %d"), path->c_str(),
func->definition_lineno());
}
if (func->is_copy) {
if (!copy_path) {
append_format(comment, _(L", copied interactively"));
} else if (*copy_path == L"-") {
append_format(comment, _(L", copied via `source`"));
} else {
append_format(comment, _(L", copied in %ls @ line %d"), copy_path->c_str(),
func->copy_definition_lineno);
}
}
if (opts.path) {
if (path) {
streams.out.append(*path);
if (final_path) {
streams.out.append(*final_path);
streams.out.append(L"\n");
}
} else if (!opts.short_output) {
streams.out.append_format(_(L"%ls is a function"), name);
streams.out.append(_(L" with definition"));
streams.out.append(L"\n");
// Function path
wcstring def = func->annotated_definition(name);
if (path) {
int line_number = func->definition_lineno();
wcstring comment;
if (*path != L"-") {
append_format(comment, L"# Defined in %ls @ line %d\n", path->c_str(),
line_number);
} else {
append_format(comment, L"# Defined via `source`\n");
}
def = comment.append(def);
} else {
wcstring comment;
append_format(comment, L"# Defined interactively\n");
def = comment.append(def);
}
wcstring def;
append_format(def, L"# %ls\n%ls", comment.c_str(),
func->annotated_definition(name).c_str());
if (!streams.out_is_redirected && isatty(STDOUT_FILENO)) {
std::vector<highlight_spec_t> colors;
highlight_shell(def, colors, parser.context());
@@ -168,11 +180,7 @@ maybe_t<int> builtin_type(parser_t &parser, io_streams_t &streams, const wchar_t
}
} else {
streams.out.append_format(_(L"%ls is a function"), name);
auto path = func->definition_file;
if (path) {
streams.out.append_format(_(L" (defined in %ls)"), path->c_str());
}
streams.out.append(L"\n");
streams.out.append_format(_(L" (%ls)\n"), comment.c_str());
}
} else if (opts.type) {
streams.out.append(L"function\n");

View File

@@ -335,7 +335,9 @@ static wcstring str2wcs_internal(const char *in, const size_t in_len) {
} else {
ret = std::mbrtowc(&wc, &in[in_pos], in_len - in_pos, &state);
// Determine whether to encode this character with our crazy scheme.
if (fish_reserved_codepoint(wc)) {
if (wc >= ENCODE_DIRECT_BASE && wc < ENCODE_DIRECT_BASE + 256) {
use_encode_direct = true;
} else if (wc == INTERNAL_SEPARATOR) {
use_encode_direct = true;
} else if (ret == static_cast<size_t>(-2)) {
// Incomplete sequence.
@@ -1311,9 +1313,6 @@ maybe_t<size_t> read_unquoted_escape(const wchar_t *input, wcstring *result, boo
}
if (result_char_or_none.has_value()) {
if (fish_reserved_codepoint(*result_char_or_none)) {
return none();
}
result->push_back(*result_char_or_none);
}

View File

@@ -366,7 +366,8 @@ class completer_t {
bool conditions_test(const wcstring_list_t &conditions);
void complete_strings(const wcstring &wc_escaped, const description_func_t &desc_func,
const completion_list_t &possible_comp, complete_flags_t flags);
const completion_list_t &possible_comp, complete_flags_t flags,
expand_flags_t extra_expand_flags = {});
expand_flags_t expand_flags() const {
expand_flags_t result{};
@@ -510,12 +511,16 @@ static void parse_cmd_string(const wcstring &str, wcstring *path, wcstring *cmd,
/// @param possible_comp
/// the list of possible completions to iterate over
/// @param flags
/// The flags
/// The flags controlling completion
/// @param extra_expand_flags
/// Additional flags controlling expansion.
void completer_t::complete_strings(const wcstring &wc_escaped, const description_func_t &desc_func,
const completion_list_t &possible_comp, complete_flags_t flags) {
const completion_list_t &possible_comp, complete_flags_t flags,
expand_flags_t extra_expand_flags) {
wcstring tmp = wc_escaped;
if (!expand_one(tmp,
this->expand_flags() | expand_flag::skip_cmdsubst | expand_flag::skip_wildcards,
this->expand_flags() | extra_expand_flags | expand_flag::skip_cmdsubst |
expand_flag::skip_wildcards,
ctx))
return;
@@ -525,7 +530,7 @@ void completer_t::complete_strings(const wcstring &wc_escaped, const description
const wcstring &comp_str = comp.completion;
if (!comp_str.empty()) {
wildcard_complete(comp_str, wc.c_str(), desc_func, &this->completions,
this->expand_flags(), flags);
this->expand_flags() | extra_expand_flags, flags);
}
}
}
@@ -730,7 +735,9 @@ void completer_t::complete_from_args(const wcstring &str, const wcstring &args,
ctx.parser->set_last_statuses(status);
}
this->complete_strings(escape_string(str), const_desc(desc), possible_comp, flags);
// Allow leading dots - see #3707.
this->complete_strings(escape_string(str), const_desc(desc), possible_comp, flags,
expand_flag::allow_nonliteral_leading_dot);
}
static size_t leading_dash_count(const wchar_t *str) {

View File

@@ -418,7 +418,7 @@ static bool filter_matches_event(const wcstring &filter, event_type_t type) {
case event_type_t::job_exit:
return filter == L"job-exit" || filter == L"exit";
case event_type_t::caller_exit:
return filter == L"process-exit" || filter == L"exit";
return filter == L"caller-exit" || filter == L"exit";
case event_type_t::generic:
return filter == L"generic";
}

View File

@@ -45,6 +45,10 @@ enum class expand_flag {
/// Disallow directory abbreviations like /u/l/b for /usr/local/bin. Only applicable if
/// fuzzy_match is set.
no_fuzzy_directories,
/// Allows matching a leading dot even if the wildcard does not contain one.
/// By default, wildcards only match a leading dot literally; this is why e.g. '*' does not
/// match hidden files.
allow_nonliteral_leading_dot,
/// Do expansions specifically to support cd. This means using CDPATH as a list of potential
/// working directories, and to use logical instead of physical paths.
special_for_cd,

View File

@@ -36,8 +36,8 @@
struct config_paths_t determine_config_directory_paths(const char *argv0);
static const wchar_t *ctrl_symbolic_names[] = {
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, L"\\a",
L"\\b", L"\\t", L"\\n", L"\\v", L"\\f", L"\\r", nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
L"\\b", L"\\t", L"\\n", nullptr, nullptr, L"\\r", nullptr, nullptr,
nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr, L"\\e", L"\\x1c", nullptr, nullptr, nullptr};

View File

@@ -231,7 +231,10 @@ void function_set_desc(const wcstring &name, const wcstring &desc, parser_t &par
}
}
bool function_copy(const wcstring &name, const wcstring &new_name) {
bool function_copy(const wcstring &name, const wcstring &new_name, parser_t &parser) {
auto filename = parser.current_filename();
auto lineno = parser.get_lineno();
auto funcset = function_set.acquire();
auto props = funcset->get_props(name);
if (!props) {
@@ -239,11 +242,11 @@ bool function_copy(const wcstring &name, const wcstring &new_name) {
return false;
}
// Copy the function's props.
// This new instance of the function shouldn't be tied to the definition file of the
// original, so clear the filename, etc.
auto new_props = copy_props(props);
new_props->is_autoload = false;
new_props->definition_file = nullptr;
new_props->is_copy = true;
new_props->copy_definition_file = filename;
new_props->copy_definition_lineno = lineno;
// Note this will NOT overwrite an existing function with the new name.
// TODO: rationalize if this behavior is desired.

View File

@@ -46,6 +46,15 @@ struct function_properties_t {
/// The file from which the function was created, or nullptr if not from a file.
filename_ref_t definition_file{};
/// Whether the function was copied.
bool is_copy{false};
/// The file from which the function was copied, or nullptr if not from a file.
filename_ref_t copy_definition_file{};
/// The line number where the specified function was copied.
int copy_definition_lineno{};
/// \return the description, localized via _.
const wchar_t *localized_description() const;
@@ -95,7 +104,7 @@ wcstring_list_t function_get_names(bool get_hidden);
/// Creates a new function using the same definition as the specified function. Returns true if copy
/// is successful.
bool function_copy(const wcstring &name, const wcstring &new_name);
bool function_copy(const wcstring &name, const wcstring &new_name, parser_t &parser);
/// Observes that fish_function_path has changed.
void function_invalidate_path();

View File

@@ -195,6 +195,9 @@ bool history_item_t::matches_search(const wcstring &term, enum history_search_ty
if (wcpattern2.back() != ANY_STRING) wcpattern2.push_back(ANY_STRING);
return wildcard_match(content_to_match, wcpattern2);
}
case history_search_type_t::contains_subsequence: {
return subsequence_in_string(term, content_to_match);
}
case history_search_type_t::match_everything: {
return true;
}

View File

@@ -57,6 +57,8 @@ enum class history_search_type_t {
contains_glob,
/// Search for commands starting with the given glob pattern.
prefix_glob,
/// Search for commands containing the given string as a subsequence
contains_subsequence,
/// Matches everything.
match_everything,
};

View File

@@ -428,15 +428,8 @@ class reader_history_search_t {
const wcstring &needle = search_string();
if (mode_ == line || mode_ == prefix) {
size_t offset = find(text, needle);
// FIXME: Previous versions asserted out if this wasn't true.
// This could be hit with a needle of "ö" and haystack of "echo Ö"
// I'm not sure why - this points to a bug in ifind (probably wrong locale?)
// However, because the user experience of having it crash is horrible,
// and the worst thing that can otherwise happen here is that a search is unsuccessful,
// we just check it instead.
if (offset != wcstring::npos) {
add_if_new({std::move(text), offset});
}
assert(offset != wcstring::npos && "Should have found a match in the search result");
add_if_new({std::move(text), offset});
} else if (mode_ == token) {
tokenizer_t tok(text.c_str(), TOK_ACCEPT_UNFINISHED);
@@ -1295,11 +1288,21 @@ static history_pager_result_t history_pager_search(const std::shared_ptr<history
completion_list_t completions;
history_search_t search{history, search_string, history_search_type_t::contains,
smartcase_flags(search_string), history_index};
while (completions.size() < page_size && search.go_to_next_match(direction)) {
bool next_match_found = search.go_to_next_match(direction);
if (!next_match_found) {
// If there were no matches, try again with subsequence search
search =
history_search_t{history, search_string, history_search_type_t::contains_subsequence,
smartcase_flags(search_string), history_index};
next_match_found = search.go_to_next_match(direction);
}
while (completions.size() < page_size && next_match_found) {
const history_item_t &item = search.current_item();
completions.push_back(completion_t{
item.str(), L"", string_fuzzy_match_t::exact_match(),
COMPLETE_REPLACES_COMMANDLINE | COMPLETE_DONT_ESCAPE | COMPLETE_DONT_SORT});
next_match_found = search.go_to_next_match(direction);
}
size_t last_index = search.current_index();
if (direction == history_search_direction_t::forward)

View File

@@ -119,7 +119,7 @@ bool string_suffixes_string_case_insensitive(const wcstring &proposed_suffix,
/// Returns true if needle, represented as a subsequence, is contained within haystack.
/// Note subsequence is not substring: "foo" is a subsequence of "follow" for example.
static bool subsequence_in_string(const wcstring &needle, const wcstring &haystack) {
bool subsequence_in_string(const wcstring &needle, const wcstring &haystack) {
// Impossible if needle is larger than haystack.
if (needle.size() > haystack.size()) {
return false;

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