mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-11 11:11:13 -03:00
Compare commits
235 Commits
faster-git
...
torn-seque
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
65556ac2ae | ||
|
|
25e5cc23c1 | ||
|
|
4012345ba9 | ||
|
|
43d583d991 | ||
|
|
d69886efe0 | ||
|
|
bd8cc6d317 | ||
|
|
9c5b3f3d57 | ||
|
|
5970f34a60 | ||
|
|
eaa837effa | ||
|
|
e52cf2f6a7 | ||
|
|
8c7568c0cb | ||
|
|
07979782a6 | ||
|
|
59b43986e9 | ||
|
|
51f3722e02 | ||
|
|
db0f9c1d53 | ||
|
|
c9901398ed | ||
|
|
6181ba3b56 | ||
|
|
d27f5a5293 | ||
|
|
c1d165de9d | ||
|
|
f0e007c439 | ||
|
|
65a4cb5245 | ||
|
|
c7262d6c05 | ||
|
|
f3c264722d | ||
|
|
39742cafa0 | ||
|
|
295d2bd218 | ||
|
|
3588b41744 | ||
|
|
82e3311756 | ||
|
|
b611c96cdd | ||
|
|
1d6fa258f6 | ||
|
|
6312b1dbd8 | ||
|
|
5fa2f62536 | ||
|
|
bbf7568ebd | ||
|
|
72347517b2 | ||
|
|
95475c35ff | ||
|
|
560d21cd86 | ||
|
|
bef453f69b | ||
|
|
fa832ead65 | ||
|
|
eb7afd2a9c | ||
|
|
f4ddcfa694 | ||
|
|
1605d8d6ce | ||
|
|
a7559a62c4 | ||
|
|
e9327d234d | ||
|
|
a3d03fc0fb | ||
|
|
1e981a9827 | ||
|
|
770f4ce6d1 | ||
|
|
aa782bdad7 | ||
|
|
e4c55131c7 | ||
|
|
e6ad78cda7 | ||
|
|
578e162f35 | ||
|
|
e9bb150a41 | ||
|
|
b5eccdf9f6 | ||
|
|
75716bd6b0 | ||
|
|
9e628995da | ||
|
|
5b39efc96d | ||
|
|
b5bb50d742 | ||
|
|
32c36aa5f8 | ||
|
|
fc37d8d5a8 | ||
|
|
8d361b4290 | ||
|
|
9789e6b731 | ||
|
|
4d67ca7c58 | ||
|
|
fbe5a53dc9 | ||
|
|
dcd93e4c52 | ||
|
|
7acd20dc7e | ||
|
|
1d893b77d3 | ||
|
|
b451650faa | ||
|
|
3e0a53ae4f | ||
|
|
e01aafab1c | ||
|
|
fd0fba83b9 | ||
|
|
6644cc9b0e | ||
|
|
f5370e6f22 | ||
|
|
d62fb9cc74 | ||
|
|
88ab024d7d | ||
|
|
1cc900ab7f | ||
|
|
144725e947 | ||
|
|
d969577f0b | ||
|
|
3e098249a5 | ||
|
|
7cd7f31a93 | ||
|
|
5e12d4e99c | ||
|
|
f98d1779dd | ||
|
|
6f18a1b314 | ||
|
|
8b102f2571 | ||
|
|
514eebb002 | ||
|
|
41eb0a2fd0 | ||
|
|
290d957ab6 | ||
|
|
08b03a733a | ||
|
|
19a17fa981 | ||
|
|
13c00c9f79 | ||
|
|
19eceff3bc | ||
|
|
6a4d3a59ab | ||
|
|
3b0d5c342b | ||
|
|
884a2d100c | ||
|
|
a4d355634d | ||
|
|
3c620f56ee | ||
|
|
7679be3126 | ||
|
|
49926cfbac | ||
|
|
963c3425a3 | ||
|
|
55bddac90a | ||
|
|
20c67692e1 | ||
|
|
1e7088fb6b | ||
|
|
0f75df7c35 | ||
|
|
edb0617d13 | ||
|
|
d2f7d238f3 | ||
|
|
a7bed39c1e | ||
|
|
06646998db | ||
|
|
096f225579 | ||
|
|
ebec8c15ab | ||
|
|
92d9646631 | ||
|
|
ab1307c63b | ||
|
|
bebf3c129f | ||
|
|
60881f1195 | ||
|
|
320ebb6859 | ||
|
|
9bf6112b60 | ||
|
|
ef1a6aba26 | ||
|
|
ba00d721f4 | ||
|
|
fe8909e8f2 | ||
|
|
d369614ad9 | ||
|
|
4f4d941760 | ||
|
|
9b19db5c5f | ||
|
|
4f46d369c4 | ||
|
|
977459949f | ||
|
|
8cbcfc0b3a | ||
|
|
77738fd646 | ||
|
|
f438e80f9b | ||
|
|
ccb9c8225f | ||
|
|
33b651ad91 | ||
|
|
a20712b51d | ||
|
|
da426a1b03 | ||
|
|
fbb2fcdb06 | ||
|
|
537b1c3dd5 | ||
|
|
b4d0538892 | ||
|
|
9222381769 | ||
|
|
f2f54919af | ||
|
|
f40e31f675 | ||
|
|
43fbfa9a0f | ||
|
|
f6dbf17446 | ||
|
|
06578bd03d | ||
|
|
6491518b97 | ||
|
|
7e03bebf97 | ||
|
|
941701da3d | ||
|
|
eb211e1d10 | ||
|
|
a317a6acd9 | ||
|
|
d3f287c520 | ||
|
|
80131acff2 | ||
|
|
85fb937a4d | ||
|
|
1e571263a0 | ||
|
|
1a0a6f544d | ||
|
|
413ce9fdb3 | ||
|
|
03e3d0aa3f | ||
|
|
00c528c13f | ||
|
|
60dbb9c8ba | ||
|
|
2104f8a18a | ||
|
|
6f18a362e6 | ||
|
|
d67fdd1f02 | ||
|
|
d92bb57418 | ||
|
|
eb4cec1fe2 | ||
|
|
ef2e30cdc1 | ||
|
|
294d589d2f | ||
|
|
415232631a | ||
|
|
e10a12c0f2 | ||
|
|
6fffb76937 | ||
|
|
36e385e1fb | ||
|
|
e598010020 | ||
|
|
eba4c906ae | ||
|
|
fbb4a8d853 | ||
|
|
10e525c49c | ||
|
|
ec27b418e4 | ||
|
|
535a09a5b3 | ||
|
|
d584f36f5d | ||
|
|
c3740b85be | ||
|
|
d840fd9a7f | ||
|
|
592b059c30 | ||
|
|
86b9a0b876 | ||
|
|
6822a772fb | ||
|
|
912d93c99d | ||
|
|
74f4742565 | ||
|
|
a47dcad1ea | ||
|
|
69bd7cc9a5 | ||
|
|
b56ee16aa9 | ||
|
|
679cef9c0e | ||
|
|
01b623efce | ||
|
|
aa627ea935 | ||
|
|
c15a900f31 | ||
|
|
1136e656e0 | ||
|
|
456c9254fa | ||
|
|
ebc16e51d7 | ||
|
|
2d7a6063b9 | ||
|
|
7c57b746d0 | ||
|
|
64442cb464 | ||
|
|
07ead04890 | ||
|
|
5346d3d491 | ||
|
|
138c6c4c40 | ||
|
|
f8751a4f97 | ||
|
|
cdc2db5eae | ||
|
|
aea9cd6165 | ||
|
|
d0a490d76b | ||
|
|
b4392f6f7d | ||
|
|
7f2f5bb2f4 | ||
|
|
c47ecf9677 | ||
|
|
cd45a8c5cc | ||
|
|
99f78fb0b1 | ||
|
|
235108e2df | ||
|
|
e66b13ac3d | ||
|
|
0c211cbffb | ||
|
|
da5a394178 | ||
|
|
59bfd3ba6c | ||
|
|
631bde1081 | ||
|
|
383d2aa3e9 | ||
|
|
cac3d0ef16 | ||
|
|
4721ffe512 | ||
|
|
df097b114c | ||
|
|
2ebe3134cf | ||
|
|
d663f553df | ||
|
|
dcde198c94 | ||
|
|
b5c393dc39 | ||
|
|
f0a54510c3 | ||
|
|
d18d414745 | ||
|
|
ac44b3da91 | ||
|
|
0903e7a8f2 | ||
|
|
894139933d | ||
|
|
1aec1d3955 | ||
|
|
a138bc328b | ||
|
|
b9583bb16a | ||
|
|
80033adcf5 | ||
|
|
51a57870eb | ||
|
|
98b3ba5e8e | ||
|
|
08bf5c92a9 | ||
|
|
a84048511e | ||
|
|
46e8f12dbf | ||
|
|
7fe92be405 | ||
|
|
366034940f | ||
|
|
6239cba1e4 | ||
|
|
75d243faaa | ||
|
|
ba86028aaa | ||
|
|
3cbb5e384b | ||
|
|
90b35335ee |
30
.cirrus.yml
30
.cirrus.yml
@@ -26,7 +26,7 @@ linux_task:
|
||||
- lscpu || true
|
||||
- (cat /proc/meminfo | grep MemTotal) || true
|
||||
- mkdir build && cd build
|
||||
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCTEST_PARALLEL_LEVEL=6 ..
|
||||
- FISH_TEST_MAX_CONCURRENCY=6 cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
|
||||
- ninja -j 6 fish
|
||||
- ninja fish_run_tests
|
||||
only_if: $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
@@ -45,7 +45,7 @@ linux_arm_task:
|
||||
- lscpu || true
|
||||
- (cat /proc/meminfo | grep MemTotal) || true
|
||||
- mkdir build && cd build
|
||||
- cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCTEST_PARALLEL_LEVEL=6 ..
|
||||
- FISH_TEST_MAX_CONCURRENCY=6 cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
|
||||
- ninja -j 6 fish
|
||||
- file ./fish
|
||||
- ninja fish_run_tests
|
||||
@@ -54,17 +54,11 @@ linux_arm_task:
|
||||
|
||||
freebsd_task:
|
||||
matrix:
|
||||
# - name: FreeBSD 14
|
||||
# freebsd_instance:
|
||||
# image_family: freebsd-14-0-snap
|
||||
- name: FreeBSD 13
|
||||
- name: FreeBSD 14
|
||||
freebsd_instance:
|
||||
image: freebsd-13-2-release-amd64
|
||||
# - name: FreeBSD 12.3
|
||||
# freebsd_instance:
|
||||
# image: freebsd-12-3-release-amd64
|
||||
image: freebsd-14-3-release-amd64-ufs
|
||||
tests_script:
|
||||
- pkg install -y cmake-core devel/pcre2 devel/ninja misc/py-pexpect git-lite terminfo-db
|
||||
- pkg install -y cmake-core devel/pcre2 devel/ninja lang/rust misc/py-pexpect git-lite
|
||||
# libclang.so is a required build dependency for rust-c++ ffi bridge
|
||||
- pkg install -y llvm
|
||||
# BSDs have the following behavior: root may open or access files even if
|
||||
@@ -77,15 +71,7 @@ freebsd_task:
|
||||
- mkdir build && cd build
|
||||
- chown -R fish-user ..
|
||||
- sudo -u fish-user -s whoami
|
||||
# FreeBSD's pkg currently has rust 1.66.0 while we need rust 1.70.0+. Use rustup to install
|
||||
# the latest, but note that it only installs rust per-user.
|
||||
- sudo -u fish-user -s fetch -qo - https://sh.rustup.rs > rustup.sh
|
||||
- sudo -u fish-user -s sh ./rustup.sh -y --profile=minimal
|
||||
# `sudo -s ...` does not invoke a login shell so we need a workaround to make sure the
|
||||
# rustup environment is configured for subsequent `sudo -s ...` commands.
|
||||
# For some reason, this doesn't do the job:
|
||||
# - sudo -u fish-user sh -c 'echo source \$HOME/.cargo/env >> $HOME/.cshrc'
|
||||
- sudo -u fish-user -s cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCTEST_PARALLEL_LEVEL=1 ..
|
||||
- sudo -u fish-user sh -c '. $HOME/.cargo/env; ninja -j 6 fish'
|
||||
- sudo -u fish-user sh -c '. $HOME/.cargo/env; ninja fish_run_tests'
|
||||
- sudo -u fish-user -s FISH_TEST_MAX_CONCURRENCY=1 cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
|
||||
- sudo -u fish-user -s ninja -j 6 fish
|
||||
- sudo -u fish-user -s ninja fish_run_tests
|
||||
only_if: $CIRRUS_REPO_OWNER == 'fish-shell'
|
||||
|
||||
@@ -15,8 +15,8 @@ indent_style = tab
|
||||
[*.{md,rst}]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{sh,ac}]
|
||||
indent_size = 2
|
||||
[*.sh]
|
||||
indent_size = 4
|
||||
|
||||
[Dockerfile]
|
||||
indent_size = 2
|
||||
|
||||
22
.github/actions/rust-toolchain@oldest-supported/action.yml
vendored
Normal file
22
.github/actions/rust-toolchain@oldest-supported/action.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Oldest Supported Rust Toolchain
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
targets:
|
||||
description: Comma-separated list of target triples to install for this toolchain
|
||||
required: false
|
||||
components:
|
||||
description: Comma-separated list of components to be additionally installed
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
with:
|
||||
targets: ${{ inputs.targets }}
|
||||
components: ${{ inputs.components}}
|
||||
22
.github/actions/rust-toolchain@stable/action.yml
vendored
Normal file
22
.github/actions/rust-toolchain@stable/action.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Stable Rust Toolchain
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
targets:
|
||||
description: Comma-separated list of target triples to install for this toolchain
|
||||
required: false
|
||||
components:
|
||||
description: Comma-separated list of components to be additionally installed
|
||||
required: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.88
|
||||
with:
|
||||
targets: ${{ inputs.targets }}
|
||||
components: ${{ inputs.components }}
|
||||
6
.github/workflows/mac_codesign.yml
vendored
6
.github/workflows/mac_codesign.yml
vendored
@@ -9,12 +9,12 @@ jobs:
|
||||
environment: macos-codesign
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Install Rust 1.73.0
|
||||
uses: dtolnay/rust-toolchain@1.73.0
|
||||
- name: Install Rust
|
||||
uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
with:
|
||||
targets: x86_64-apple-darwin
|
||||
- name: Install Rust Stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
uses: ./.github/actions/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin
|
||||
- name: build-and-codesign
|
||||
|
||||
13
.github/workflows/main.yml
vendored
13
.github/workflows/main.yml
vendored
@@ -3,7 +3,7 @@ name: make fish_run_tests
|
||||
on: [push, pull_request]
|
||||
|
||||
env:
|
||||
CTEST_PARALLEL_LEVEL: "4"
|
||||
FISH_TEST_MAX_CONCURRENCY: "4"
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||
|
||||
permissions:
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect python3-sphinx tmux
|
||||
@@ -32,11 +32,8 @@ jobs:
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- name: translation updates
|
||||
run: |
|
||||
# Required for our custom xgettext implementation.
|
||||
cargo install --locked --version 1.0.106 cargo-expand
|
||||
# Generate PO files. This should not result it a change in the repo if all translations are
|
||||
# up to date.
|
||||
# Ensure that fish is available as an executable.
|
||||
@@ -50,7 +47,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
with:
|
||||
targets: "i586-unknown-linux-gnu" # rust-toolchain wants this comma-separated
|
||||
- name: Install deps
|
||||
@@ -131,7 +128,7 @@ jobs:
|
||||
#
|
||||
# steps:
|
||||
# - uses: actions/checkout@v4
|
||||
# - uses: dtolnay/rust-toolchain@1.70
|
||||
# - uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
# - name: Install deps
|
||||
# run: |
|
||||
# sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
@@ -159,7 +156,7 @@ jobs:
|
||||
CARGO_NET_GIT_FETCH_WITH_CLI: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
- name: Install deps
|
||||
run: |
|
||||
# --break-system-packages because homebrew has now declared itself "externally managed".
|
||||
|
||||
54
.github/workflows/rust_checks.yml
vendored
54
.github/workflows/rust_checks.yml
vendored
@@ -8,34 +8,48 @@ permissions:
|
||||
jobs:
|
||||
rustfmt:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: ./.github/actions/rust-toolchain@stable
|
||||
with:
|
||||
components: rustfmt
|
||||
- name: cargo fmt
|
||||
run: cargo fmt --check --all
|
||||
run: cargo fmt --check
|
||||
|
||||
clippy:
|
||||
clippy-stable:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: dtolnay/rust-toolchain@stable
|
||||
- uses: ./.github/actions/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev
|
||||
- name: cmake
|
||||
run: |
|
||||
cmake -B build
|
||||
sudo apt install gettext
|
||||
- name: cargo clippy
|
||||
# This used to have --deny=warnings, but that turns rust release day
|
||||
# into automatic CI failure day, so we don't do that.
|
||||
run: cargo clippy --workspace --all-targets
|
||||
run: cargo clippy --workspace --all-targets -- --deny=warnings
|
||||
|
||||
# Disabling for now because it also checks "advisories",
|
||||
# making CI fail for reasons unrelated to the patch
|
||||
# cargo-deny:
|
||||
# runs-on: ubuntu-latest
|
||||
# steps:
|
||||
# - uses: actions/checkout@v3
|
||||
# - uses: EmbarkStudios/cargo-deny-action@v1
|
||||
clippy-msrv:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
with:
|
||||
components: clippy
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext
|
||||
- name: cargo clippy
|
||||
run: cargo clippy --workspace --all-targets -- --deny=warnings
|
||||
|
||||
rustdoc:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ./.github/actions/rust-toolchain@stable
|
||||
- name: cargo doc
|
||||
run: |
|
||||
RUSTDOCFLAGS='-D warnings' cargo doc --workspace
|
||||
- name: cargo doctest
|
||||
run: |
|
||||
cargo test --doc --workspace
|
||||
|
||||
10
.github/workflows/staticbuild.yml
vendored
10
.github/workflows/staticbuild.yml
vendored
@@ -7,10 +7,6 @@ on:
|
||||
# - cron: "14 13 * * *"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
CTEST_PARALLEL_LEVEL: "1"
|
||||
CMAKE_BUILD_PARALLEL_LEVEL: "4"
|
||||
|
||||
jobs:
|
||||
staticbuilds-linux:
|
||||
|
||||
@@ -20,7 +16,7 @@ jobs:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
@@ -36,7 +32,7 @@ jobs:
|
||||
cargo build --release --target x86_64-unknown-linux-musl
|
||||
- name: Test
|
||||
run: |
|
||||
test -e tests/test_driver.py && tests/test_driver.py -f /tmp target/x86_64-unknown-linux-musl/release/
|
||||
tests/test_driver.py target/x86_64-unknown-linux-musl/release/
|
||||
- name: Compress
|
||||
run: |
|
||||
tar -cazf fish-static-x86_64-$(git describe).tar.xz -C target/x86_64-unknown-linux-musl/release/ fish
|
||||
@@ -55,7 +51,7 @@ jobs:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: dtolnay/rust-toolchain@1.70
|
||||
- uses: ./.github/actions/rust-toolchain@oldest-supported
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -38,7 +38,6 @@ Desktop.ini
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
po/template.po
|
||||
*.mo
|
||||
.directory
|
||||
.fuse_hidden*
|
||||
@@ -78,6 +77,7 @@ __pycache__
|
||||
/share/__fish_build_paths.fish
|
||||
/share/pkgconfig
|
||||
/tests/*.tmp.*
|
||||
/tests/.last-check-all-files
|
||||
|
||||
# xcode
|
||||
## Build generated
|
||||
|
||||
@@ -50,6 +50,7 @@ Interactive improvements
|
||||
- Left mouse click (as requested by `click_events <terminal-compatibility.html#click-events>`__) can now select pager items (:issue:`10932`).
|
||||
- Instead of flashing all the text to the left of the cursor, fish now flashes the matched token during history token search, the completed token during completion (:issue:`11050`), the autosuggestion when deleting it, and the full command line in all other cases.
|
||||
- Pasted commands are now stripped of any ``$`` prefix.
|
||||
- The :kbd:`alt-s` binding will now also use ``run0`` if available.
|
||||
|
||||
New or improved bindings
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -63,6 +64,7 @@ New or improved bindings
|
||||
this is only enabled by default if the terminal advertises support for the ``indn`` capability via XTGETTCAP.
|
||||
- Bindings using shift with non-ASCII letters (such as :kbd:`ctrl-shift-ä`) are now supported.
|
||||
If there is any modifier other than shift, this is the recommended notation (as opposed to :kbd:`ctrl-Ä`).
|
||||
- Vi mode has learned :kbd:`ctrl-a` (increment) and :kbd:`ctrl-x` (decrement) (:issue:`11570`).
|
||||
|
||||
Completions
|
||||
^^^^^^^^^^^
|
||||
|
||||
@@ -219,12 +219,10 @@ Or you can run them on a fish, without involving cmake::
|
||||
|
||||
cargo build
|
||||
cargo test # for the unit tests
|
||||
tests/test_driver.py --cachedir=/tmp target/debug # for the script and interactive tests
|
||||
tests/test_driver.py target/debug # for the script and interactive tests
|
||||
|
||||
Here, the first argument to test_driver.py refers to a directory with ``fish``, ``fish_indent`` and ``fish_key_reader`` in it.
|
||||
In this example we're in the root of the git repo and have run ``cargo build`` without ``--release``, so it's a debug build.
|
||||
The ``--cachedir /tmp`` argument means it will keep the fish_test_helper binary in /tmp instead of recompiling it for every test.
|
||||
This saves some time, but isn't strictly necessary.
|
||||
|
||||
Git hooks
|
||||
---------
|
||||
@@ -297,12 +295,6 @@ Adding translations for a new language
|
||||
Creating new translations requires the Gettext tools.
|
||||
More specifically, you will need ``msguniq`` and ``msgmerge`` for creating translations for a new
|
||||
language.
|
||||
In addition, the ``cargo-expand`` tool is required.
|
||||
If you have ``cargo`` installed, run::
|
||||
|
||||
cargo install --locked --version 1.0.106 cargo-expand
|
||||
|
||||
to install ``cargo-expand`` (Note that other versions might not work correctly with our scripts).
|
||||
To create a new translation, run::
|
||||
|
||||
build_tools/update_translations.fish po/LANG.po
|
||||
|
||||
16
Cargo.lock
generated
16
Cargo.lock
generated
@@ -104,6 +104,7 @@ dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
"errno",
|
||||
"fish-gettext-extraction",
|
||||
"fish-printf",
|
||||
"libc",
|
||||
"lru",
|
||||
@@ -121,6 +122,13 @@ dependencies = [
|
||||
"widestring",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fish-gettext-extraction"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fish-printf"
|
||||
version = "0.2.1"
|
||||
@@ -348,18 +356,18 @@ checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6"
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "1.0.92"
|
||||
version = "1.0.95"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0"
|
||||
checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778"
|
||||
dependencies = [
|
||||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "quote"
|
||||
version = "1.0.38"
|
||||
version = "1.0.40"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc"
|
||||
checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["printf"]
|
||||
members = ["printf", "gettext-extraction"]
|
||||
|
||||
[workspace.package]
|
||||
# To build revisions that use Corrosion (those before 2024-01), use CMake 3.19, Rustc 1.78 and Rustup 1.27.
|
||||
rust-version = "1.70"
|
||||
edition = "2021"
|
||||
repository = "https://github.com/fish-shell/fish-shell"
|
||||
|
||||
[profile.release]
|
||||
overflow-checks = true
|
||||
@@ -24,7 +25,6 @@ default-run = "fish"
|
||||
# see doc_src/license.rst for details
|
||||
# don't forget to update COPYING and debian/copyright too
|
||||
license = "GPL-2.0-only AND LGPL-2.0-or-later AND MIT AND PSF-2.0"
|
||||
repository = "https://github.com/fish-shell/fish-shell"
|
||||
homepage = "https://fishshell.com"
|
||||
readme = "README.rst"
|
||||
|
||||
@@ -49,6 +49,7 @@ nix = { version = "0.30.1", default-features = false, features = [
|
||||
num-traits = "0.2.19"
|
||||
once_cell = "1.19.0"
|
||||
fish-printf = { path = "./printf", features = ["widestring"] }
|
||||
fish-gettext-extraction = { path = "./gettext-extraction" }
|
||||
|
||||
# Don't use the "getrandom" feature as it requires "getentropy" which was not
|
||||
# available on macOS < 10.12. We can enable "getrandom" when we raise the
|
||||
|
||||
63
build.rs
63
build.rs
@@ -3,7 +3,16 @@
|
||||
use rsconf::{LinkType, Target};
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::Path;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
fn canonicalize<P: AsRef<Path>>(path: P) -> PathBuf {
|
||||
std::fs::canonicalize(path).unwrap()
|
||||
}
|
||||
fn canonicalize_str<P: AsRef<Path>>(path: P) -> String {
|
||||
canonicalize(path).to_str().unwrap().to_owned()
|
||||
}
|
||||
|
||||
const MANIFEST_DIR: &str = env!("CARGO_MANIFEST_DIR");
|
||||
|
||||
fn main() {
|
||||
setup_paths();
|
||||
@@ -11,23 +20,19 @@ fn main() {
|
||||
// Add our default to enable tools that don't go through CMake, like "cargo test" and the
|
||||
// language server.
|
||||
|
||||
let cargo_target_dir: PathBuf = option_env!("CARGO_TARGET_DIR")
|
||||
.map(canonicalize)
|
||||
.unwrap_or(canonicalize(MANIFEST_DIR).join("target"));
|
||||
|
||||
// FISH_BUILD_DIR is set by CMake, if we are using it.
|
||||
// OUT_DIR is set by Cargo when the build script is running (not compiling)
|
||||
let default_build_dir = env::var("OUT_DIR").unwrap();
|
||||
let build_dir = option_env!("FISH_BUILD_DIR").unwrap_or(&default_build_dir);
|
||||
let build_dir = std::fs::canonicalize(build_dir).unwrap();
|
||||
let build_dir = build_dir.to_str().unwrap();
|
||||
rsconf::set_env_value("FISH_BUILD_DIR", build_dir);
|
||||
rsconf::set_env_value(
|
||||
"FISH_BUILD_DIR",
|
||||
option_env!("FISH_BUILD_DIR").unwrap_or(cargo_target_dir.to_str().unwrap()),
|
||||
);
|
||||
|
||||
// We need to canonicalize (i.e. realpath) the manifest dir because we want to be able to
|
||||
// compare it directly as a string at runtime.
|
||||
rsconf::set_env_value(
|
||||
"CARGO_MANIFEST_DIR",
|
||||
std::fs::canonicalize(env!("CARGO_MANIFEST_DIR"))
|
||||
.unwrap()
|
||||
.as_path()
|
||||
.to_str()
|
||||
.unwrap(),
|
||||
);
|
||||
rsconf::set_env_value("CARGO_MANIFEST_DIR", &canonicalize_str(MANIFEST_DIR));
|
||||
|
||||
// Some build info
|
||||
rsconf::set_env_value("BUILD_TARGET_TRIPLE", &env::var("TARGET").unwrap());
|
||||
@@ -41,8 +46,7 @@ fn main() {
|
||||
|
||||
std::env::set_var("FISH_BUILD_VERSION", version);
|
||||
|
||||
let cman = std::fs::canonicalize(env!("CARGO_MANIFEST_DIR")).unwrap();
|
||||
let targetman = cman.as_path().join("target").join("man");
|
||||
let targetman = cargo_target_dir.join("fish-man");
|
||||
|
||||
#[cfg(feature = "embed-data")]
|
||||
#[cfg(not(clippy))]
|
||||
@@ -63,10 +67,9 @@ fn main() {
|
||||
#[cfg(not(debug_assertions))]
|
||||
rsconf::rebuild_if_paths_changed(&["doc_src", "share"]);
|
||||
|
||||
cc::Build::new()
|
||||
.file("src/libc.c")
|
||||
.include(build_dir)
|
||||
.compile("flibc.a");
|
||||
rsconf::rebuild_if_env_changed("FISH_GETTEXT_EXTRACTION_FILE");
|
||||
|
||||
cc::Build::new().file("src/libc.c").compile("flibc.a");
|
||||
|
||||
let mut build = cc::Build::new();
|
||||
// Add to the default library search path
|
||||
@@ -252,8 +255,6 @@ fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
}
|
||||
|
||||
fn setup_paths() {
|
||||
#[cfg(unix)]
|
||||
use std::path::PathBuf;
|
||||
#[cfg(windows)]
|
||||
use unix_path::{Path, PathBuf};
|
||||
|
||||
@@ -324,7 +325,7 @@ fn get_version(src_dir: &Path) -> String {
|
||||
|
||||
let path = src_dir.join("version");
|
||||
if let Ok(strver) = read_to_string(path) {
|
||||
return strver.to_string();
|
||||
return strver;
|
||||
}
|
||||
|
||||
let args = &["describe", "--always", "--dirty=-dirty"];
|
||||
@@ -351,8 +352,8 @@ fn get_version(src_dir: &Path) -> String {
|
||||
// or because it refused (safe.directory applies to `git describe`!)
|
||||
// So we read the SHA ourselves.
|
||||
fn get_git_hash() -> Result<String, Box<dyn std::error::Error>> {
|
||||
let gitdir = Path::new(env!("CARGO_MANIFEST_DIR")).join(".git");
|
||||
let jjdir = Path::new(env!("CARGO_MANIFEST_DIR")).join(".jj");
|
||||
let gitdir = Path::new(MANIFEST_DIR).join(".git");
|
||||
let jjdir = Path::new(MANIFEST_DIR).join(".jj");
|
||||
let commit_id = if gitdir.exists() {
|
||||
// .git/HEAD contains ref: refs/heads/branch
|
||||
let headpath = gitdir.join("HEAD");
|
||||
@@ -397,10 +398,7 @@ fn build_man(build_dir: &Path) {
|
||||
use std::process::Command;
|
||||
let mandir = build_dir;
|
||||
let sec1dir = mandir.join("man1");
|
||||
let docsrc_path = std::fs::canonicalize(env!("CARGO_MANIFEST_DIR"))
|
||||
.unwrap()
|
||||
.as_path()
|
||||
.join("doc_src");
|
||||
let docsrc_path = canonicalize(MANIFEST_DIR).join("doc_src");
|
||||
let docsrc = docsrc_path.to_str().unwrap();
|
||||
let args = &[
|
||||
"-j",
|
||||
@@ -450,10 +448,7 @@ fn build_man(build_dir: &Path) {
|
||||
);
|
||||
}
|
||||
Ok(out) => {
|
||||
if out.success() {
|
||||
// Success!
|
||||
return;
|
||||
} else {
|
||||
if !out.success() {
|
||||
panic!("sphinx-build failed to build the man pages.");
|
||||
}
|
||||
}
|
||||
|
||||
54
build_tools/check.sh
Executable file
54
build_tools/check.sh
Executable file
@@ -0,0 +1,54 @@
|
||||
#!/bin/sh
|
||||
|
||||
{
|
||||
set -ex
|
||||
|
||||
lint=true
|
||||
if [ "$FISH_CHECK_LINT" = false ]; then
|
||||
lint=false
|
||||
fi
|
||||
|
||||
cargo_args=$FISH_CHECK_CARGO_ARGS
|
||||
target_triple=$FISH_CHECK_TARGET_TRIPLE
|
||||
if [ -n "$target_triple" ]; then
|
||||
cargo_args="$cargo_args --target=$FISH_CHECK_TARGET_TRIPLE"
|
||||
fi
|
||||
|
||||
cargo() {
|
||||
subcmd=$1
|
||||
shift
|
||||
# shellcheck disable=2086
|
||||
command cargo "$subcmd" $cargo_args "$@"
|
||||
}
|
||||
|
||||
cleanup () {
|
||||
if [ -n "$template_file" ] && [ -e "$template_file" ]; then
|
||||
rm "$template_file"
|
||||
fi
|
||||
}
|
||||
|
||||
trap cleanup EXIT INT TERM HUP
|
||||
|
||||
if $lint; then
|
||||
export RUSTFLAGS="--deny=warnings ${RUSTFLAGS}"
|
||||
export RUSTDOCFLAGS="--deny=warnings ${RUSTDOCFLAGS}"
|
||||
fi
|
||||
|
||||
repo_root="$(dirname "$0")/.."
|
||||
build_dir="${CARGO_TARGET_DIR:-$repo_root/target}/${target_triple}/debug"
|
||||
|
||||
template_file=$(mktemp)
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$template_file cargo build --workspace --all-targets
|
||||
if $lint; then
|
||||
PATH="$build_dir:$PATH" "$repo_root/build_tools/style.fish" --all --check
|
||||
cargo clippy --workspace --all-targets
|
||||
fi
|
||||
cargo test --no-default-features --workspace --all-targets
|
||||
cargo test --doc --workspace
|
||||
if $lint; then
|
||||
cargo doc --workspace
|
||||
fi
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$template_file "$repo_root/tests/test_driver.py" "$build_dir"
|
||||
|
||||
exit
|
||||
}
|
||||
@@ -5,7 +5,8 @@
|
||||
#
|
||||
# Usage: ./diff_profiles.fish profile1.log profile2.log > profile_diff.log
|
||||
|
||||
if test (count $argv) -ne 2;
|
||||
if test (count $argv) -ne 2
|
||||
|
||||
echo "Incorrect number of arguments."
|
||||
echo "Usage: "(status filename)" profile1.log profile2.log"
|
||||
exit 1
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
#
|
||||
# Tool to generate gettext messages template file.
|
||||
# Writes to stdout.
|
||||
# Intended to be called from `update_translations.fish`.
|
||||
|
||||
argparse use-existing-template= -- $argv
|
||||
or exit $status
|
||||
|
||||
begin
|
||||
# Write header. This is required by msguniq.
|
||||
@@ -15,45 +19,25 @@ begin
|
||||
echo ""
|
||||
end
|
||||
|
||||
set -l cargo_expanded_file (mktemp)
|
||||
# This is a gigantic crime.
|
||||
# We use cargo-expand to get all our wgettext invocations.
|
||||
# This might be replaced once we have a tool which properly handles macro expansions.
|
||||
begin
|
||||
cargo expand --lib
|
||||
for f in fish fish_indent fish_key_reader
|
||||
cargo expand --bin $f
|
||||
end
|
||||
end >$cargo_expanded_file
|
||||
set -g repo_root (status dirname)/..
|
||||
|
||||
set -l rust_string_file (mktemp)
|
||||
set -l rust_extraction_file
|
||||
if set -l --query _flag_use_existing_template
|
||||
set rust_extraction_file $_flag_use_existing_template
|
||||
else
|
||||
set rust_extraction_file (mktemp)
|
||||
# We need to build to ensure that the proc macro for extracting strings runs.
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$rust_extraction_file cargo check
|
||||
or exit 1
|
||||
end
|
||||
|
||||
# Extract any gettext call
|
||||
grep -A1 wgettext_static_str <$cargo_expanded_file |
|
||||
grep 'widestring::internals::core::primitive::str =' |
|
||||
string match -rg '"(.*)"' |
|
||||
string match -rv '^%ls$|^$' |
|
||||
# escaping difference between gettext and cargo-expand: single-quotes
|
||||
string replace -a "\'" "'" >$rust_string_file
|
||||
# Get rid of duplicates and sort.
|
||||
msguniq --no-wrap --strict --sort-output $rust_extraction_file
|
||||
or exit 1
|
||||
|
||||
# Extract any constants
|
||||
grep -Ev 'BUILD_VERSION:|PACKAGE_NAME' <$cargo_expanded_file |
|
||||
grep -E 'const [A-Z_]*: &str = "(.*)"' |
|
||||
sed -E -e 's/^.*const [A-Z_]*: &str = "(.*)".*$/\1/' -e "s_\\\'_'_g" >>$rust_string_file
|
||||
|
||||
rm $cargo_expanded_file
|
||||
|
||||
# Sort the extracted strings and remove duplicates.
|
||||
# Then, transform them into the po format.
|
||||
# If a string contains a '%' it is considered a format string and marked with a '#, c-format'.
|
||||
# This allows msgfmt to identify issues with translations whose format string does not match the
|
||||
# original.
|
||||
sort -u $rust_string_file |
|
||||
sed -E -e '/%/ i\
|
||||
#, c-format
|
||||
' -e 's/^(.*)$/msgid "\1"\nmsgstr ""\n/'
|
||||
|
||||
rm $rust_string_file
|
||||
if not set -l --query _flag_use_existing_template
|
||||
rm $rust_extraction_file
|
||||
end
|
||||
|
||||
function extract_fish_script_messages --argument-names regex
|
||||
|
||||
@@ -75,13 +59,15 @@ begin
|
||||
# 5. Double quotes are escaped, such that they are not interpreted as the start or end of
|
||||
# a msgid.
|
||||
# 6. We transform the string into the format expected in a PO file.
|
||||
cat share/config.fish share/completions/*.fish share/functions/*.fish |
|
||||
cat $share_dir/config.fish $share_dir/completions/*.fish $share_dir/functions/*.fish |
|
||||
string replace --filter --regex $regex '$1' |
|
||||
string unescape |
|
||||
sort -u |
|
||||
sed -E -e 's_\\\\_\\\\\\\\_g' -e 's_"_\\\\"_g' -e 's_^(.*)$_msgid "\1"\nmsgstr ""\n_'
|
||||
end
|
||||
|
||||
set -g share_dir $repo_root/share
|
||||
|
||||
# This regex handles explicit requests to translate a message. These are more important to translate
|
||||
# than messages which should be implicitly translated.
|
||||
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
# Script to produce an OS X installer .pkg and .app(.zip)
|
||||
|
||||
usage() {
|
||||
echo "Build macOS packages, optionally signing and notarizing them."
|
||||
echo "Usage: $0 options"
|
||||
echo "Options:"
|
||||
echo " -s Enables code signing"
|
||||
echo " -f <APP_KEY.p12> Path to .p12 file for application signing"
|
||||
echo " -i <INSTALLER_KEY.p12> Path to .p12 file for installer signing"
|
||||
echo " -p <PASSWORD> Password for the .p12 files (necessary to access the certificates)"
|
||||
echo " -e <entitlements file> (Optional) Path to an entitlements XML file"
|
||||
echo " -n Enables notarization. This will fail if code signing is not also enabled."
|
||||
echo " -j <API_KEY.JSON> Path to JSON file generated with \`rcodesign encode-app-store-connect-api-key\` (required for notarization)"
|
||||
echo
|
||||
exit 1
|
||||
echo "Build macOS packages, optionally signing and notarizing them."
|
||||
echo "Usage: $0 options"
|
||||
echo "Options:"
|
||||
echo " -s Enables code signing"
|
||||
echo " -f <APP_KEY.p12> Path to .p12 file for application signing"
|
||||
echo " -i <INSTALLER_KEY.p12> Path to .p12 file for installer signing"
|
||||
echo " -p <PASSWORD> Password for the .p12 files (necessary to access the certificates)"
|
||||
echo " -e <entitlements file> (Optional) Path to an entitlements XML file"
|
||||
echo " -n Enables notarization. This will fail if code signing is not also enabled."
|
||||
echo " -j <API_KEY.JSON> Path to JSON file generated with \`rcodesign encode-app-store-connect-api-key\` (required for notarization)"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
set -x
|
||||
@@ -30,35 +30,35 @@ X86_64_DEPLOY_TARGET='MACOSX_DEPLOYMENT_TARGET=10.9'
|
||||
# The first supported version of macOS on arm64 is 10.15, so any Rust is fine for arm64.
|
||||
# We wish to support back to 10.9 on x86-64; the last version of Rust to support that is
|
||||
# version 1.73.0.
|
||||
RUST_VERSION_X86_64=1.73.0
|
||||
RUST_VERSION_X86_64=1.70.0
|
||||
|
||||
while getopts "sf:i:p:e:nj:" opt; do
|
||||
case $opt in
|
||||
s) SIGN=1;;
|
||||
f) P12_APP_FILE=$(realpath "$OPTARG");;
|
||||
i) P12_INSTALL_FILE=$(realpath "$OPTARG");;
|
||||
p) P12_PASSWORD="$OPTARG";;
|
||||
e) ENTITLEMENTS_FILE=$(realpath "$OPTARG");;
|
||||
n) NOTARIZE=1;;
|
||||
j) API_KEY_FILE=$(realpath "$OPTARG");;
|
||||
\?) usage;;
|
||||
esac
|
||||
case $opt in
|
||||
s) SIGN=1;;
|
||||
f) P12_APP_FILE=$(realpath "$OPTARG");;
|
||||
i) P12_INSTALL_FILE=$(realpath "$OPTARG");;
|
||||
p) P12_PASSWORD="$OPTARG";;
|
||||
e) ENTITLEMENTS_FILE=$(realpath "$OPTARG");;
|
||||
n) NOTARIZE=1;;
|
||||
j) API_KEY_FILE=$(realpath "$OPTARG");;
|
||||
\?) usage;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ -n "$SIGN" ] && { [ -z "$P12_APP_FILE" ] || [ -z "$P12_INSTALL_FILE" ] || [ -z "$P12_PASSWORD" ]; }; then
|
||||
usage
|
||||
usage
|
||||
fi
|
||||
|
||||
if [ -n "$NOTARIZE" ] && [ -z "$API_KEY_FILE" ]; then
|
||||
usage
|
||||
usage
|
||||
fi
|
||||
|
||||
VERSION=$(git describe --always --dirty 2>/dev/null)
|
||||
if test -z "$VERSION" ; then
|
||||
echo "Could not get version from git"
|
||||
if test -f version; then
|
||||
VERSION=$(cat version)
|
||||
fi
|
||||
echo "Could not get version from git"
|
||||
if test -f version; then
|
||||
VERSION=$(cat version)
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Version is $VERSION"
|
||||
@@ -76,7 +76,7 @@ mkdir -p "$PKGDIR/build_x86_64" "$PKGDIR/build_arm64" "$PKGDIR/root" "$PKGDIR/in
|
||||
# and will probably not be built universal, so the package will fail to validate/run on other systems.
|
||||
# Note CMAKE_OSX_ARCHITECTURES is still relevant for the Mac app.
|
||||
{ cd "$PKGDIR/build_arm64" \
|
||||
&& cmake \
|
||||
&& cmake \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-ld_classic" \
|
||||
-DWITH_GETTEXT=OFF \
|
||||
@@ -91,7 +91,7 @@ mkdir -p "$PKGDIR/build_x86_64" "$PKGDIR/build_arm64" "$PKGDIR/root" "$PKGDIR/in
|
||||
# Build for x86-64 but do not install; instead we will make some fat binaries inside the root.
|
||||
# Set RUST_VERSION_X86_64 to the last version of Rust that supports macOS 10.9.
|
||||
{ cd "$PKGDIR/build_x86_64" \
|
||||
&& cmake \
|
||||
&& cmake \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-DCMAKE_EXE_LINKER_FLAGS="-Wl,-ld_classic" \
|
||||
-DWITH_GETTEXT=OFF \
|
||||
@@ -99,7 +99,7 @@ mkdir -p "$PKGDIR/build_x86_64" "$PKGDIR/build_arm64" "$PKGDIR/root" "$PKGDIR/in
|
||||
-DRust_CARGO_TARGET=x86_64-apple-darwin \
|
||||
-DCMAKE_OSX_ARCHITECTURES='arm64;x86_64' \
|
||||
-DFISH_USE_SYSTEM_PCRE2=OFF "$SRC_DIR" \
|
||||
&& env $X86_64_DEPLOY_TARGET make VERBOSE=1 -j 12; }
|
||||
&& env $X86_64_DEPLOY_TARGET make VERBOSE=1 -j 12; }
|
||||
|
||||
# Fatten them up.
|
||||
for FILE in "$PKGDIR"/root/usr/local/bin/*; do
|
||||
|
||||
@@ -18,22 +18,22 @@ set -e
|
||||
BUILD_TOOL="make"
|
||||
BUILD_GENERATOR="Unix Makefiles"
|
||||
if command -v ninja >/dev/null; then
|
||||
BUILD_TOOL="ninja"
|
||||
BUILD_GENERATOR="Ninja"
|
||||
BUILD_TOOL="ninja"
|
||||
BUILD_GENERATOR="Ninja"
|
||||
fi
|
||||
|
||||
# We need GNU tar as that supports the --mtime and --transform options
|
||||
TAR=notfound
|
||||
for try in tar gtar gnutar; do
|
||||
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||
TAR=$try
|
||||
break
|
||||
fi
|
||||
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||
TAR=$try
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$TAR" = "notfound" ]; then
|
||||
echo 'No suitable tar (supporting --mtime) found as tar/gtar/gnutar in PATH'
|
||||
exit 1
|
||||
echo 'No suitable tar (supporting --mtime) found as tar/gtar/gnutar in PATH'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the current directory, which we'll use for symlinks
|
||||
@@ -63,7 +63,7 @@ cmake -G "$BUILD_GENERATOR" -DCMAKE_BUILD_TYPE=Debug "$wd"
|
||||
$BUILD_TOOL doc
|
||||
|
||||
TAR_APPEND="$TAR --append --file=$path --mtime=now --owner=0 --group=0 \
|
||||
--mode=g+w,a+rX --transform s/^/$prefix\//"
|
||||
--mode=g+w,a+rX --transform s/^/$prefix\//"
|
||||
$TAR_APPEND --no-recursion user_doc
|
||||
$TAR_APPEND user_doc/html user_doc/man
|
||||
$TAR_APPEND version
|
||||
|
||||
@@ -11,15 +11,15 @@ set -e
|
||||
# We need GNU tar as that supports the --mtime and --transform options
|
||||
TAR=notfound
|
||||
for try in tar gtar gnutar; do
|
||||
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||
TAR=$try
|
||||
break
|
||||
fi
|
||||
if $try -Pcf /dev/null --mtime now /dev/null >/dev/null 2>&1; then
|
||||
TAR=$try
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$TAR" = "notfound" ]; then
|
||||
echo 'No suitable tar (supporting --mtime) found as tar/gtar/gnutar in PATH'
|
||||
exit 1
|
||||
echo 'No suitable tar (supporting --mtime) found as tar/gtar/gnutar in PATH'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get the current directory, which we'll use for telling Cargo where to find the sources
|
||||
|
||||
@@ -1,38 +1,53 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# This runs C++ files and fish scripts (*.fish) through their respective code
|
||||
# formatting programs.
|
||||
# This runs Python files, fish scripts (*.fish), and Rust files
|
||||
# through their respective code formatting programs.
|
||||
#
|
||||
# `--all`: Format all eligible files instead of the ones specified as arguments.
|
||||
# `--check`: Instead of reformatting, fail if a file is not formatted correctly.
|
||||
# `--force`: Proceed without asking if uncommitted changes are detected.
|
||||
# Only relevant if `--all` is specified but `--check` is not specified.
|
||||
|
||||
set -l fish_files
|
||||
set -l python_files
|
||||
set -l rust_files
|
||||
set -l all no
|
||||
|
||||
if test "$argv[1]" = --all
|
||||
argparse all check force -- $argv
|
||||
or exit $status
|
||||
|
||||
if set -l -q _flag_all
|
||||
set all yes
|
||||
set -e argv[1]
|
||||
if set -q argv[1]
|
||||
echo "Unexpected arguments: '$argv'"
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
||||
if set -q argv[1]
|
||||
echo "Unexpected arguments: '$argv'"
|
||||
exit 1
|
||||
end
|
||||
set -l repo_root (status dirname)/..
|
||||
|
||||
if test $all = yes
|
||||
set -l files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//')
|
||||
if set -q files[1]
|
||||
echo
|
||||
echo 'You have uncommitted changes. Are you sure you want to restyle?'
|
||||
read -P 'y/N? ' -n1 -l ans
|
||||
if not string match -qi y -- $ans
|
||||
exit 1
|
||||
if not set -l -q _flag_force; and not set -l -q _flag_check
|
||||
# Potential for false positives: Not all fish files are formatted, see the `fish_files`
|
||||
# definition below.
|
||||
set -l relevant_uncommitted_changes (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//' | grep -E '.*\.(fish|py|rs)$')
|
||||
if set -q relevant_uncommitted_changes[1]
|
||||
for changed_file in $relevant_uncommitted_changes
|
||||
echo $changed_file
|
||||
end
|
||||
echo
|
||||
echo 'You have uncommitted changes (listed above). Are you sure you want to restyle?'
|
||||
read -P 'y/N? ' -n1 -l ans
|
||||
if not string match -qi y -- $ans
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
set fish_files share/**.fish
|
||||
set fish_files $repo_root/{benchmarks,build_tools,etc,share}/**.fish
|
||||
set python_files {doc_src,share,tests}/**.py
|
||||
set rust_files fish-rust/src/**.rs
|
||||
else
|
||||
# Extract just the fish files.
|
||||
# Format the files specified as arguments.
|
||||
set -l files $argv
|
||||
set fish_files (string match -r '^.*\.fish$' -- $files)
|
||||
set python_files (string match -r '^.*\.py$' -- $files)
|
||||
set rust_files (string match -r '^.*\.rs$' -- $files)
|
||||
@@ -40,37 +55,70 @@ end
|
||||
|
||||
set -l red (set_color red)
|
||||
set -l green (set_color green)
|
||||
set -l blue (set_color blue)
|
||||
set -l yellow (set_color yellow)
|
||||
set -l normal (set_color normal)
|
||||
|
||||
# Run the fish reformatter if we have any fish files.
|
||||
if set -q fish_files[1]
|
||||
if not type -q fish_indent
|
||||
make fish_indent
|
||||
set PATH . $PATH
|
||||
echo
|
||||
echo $yellow'Could not find `fish_indent` in `$PATH`.'$normal
|
||||
exit 127
|
||||
end
|
||||
echo === Running "$green"fish_indent"$normal"
|
||||
fish_indent -w -- $fish_files
|
||||
if set -l -q _flag_check
|
||||
if not fish_indent --check -- $fish_files
|
||||
echo $red"Fish files are not formatted correctly."$normal
|
||||
exit 1
|
||||
end
|
||||
else
|
||||
fish_indent -w -- $fish_files
|
||||
end
|
||||
end
|
||||
|
||||
if set -q python_files[1]
|
||||
if not type -q black
|
||||
echo
|
||||
echo Please install "`black`" to style python
|
||||
echo
|
||||
echo $yellow'Please install `black` to style python'$normal
|
||||
exit 127
|
||||
end
|
||||
echo === Running "$green"black"$normal"
|
||||
if set -l -q _flag_check
|
||||
if not black --check $python_files
|
||||
echo $red"Python files are not formatted correctly."$normal
|
||||
exit 1
|
||||
end
|
||||
else
|
||||
echo === Running "$blue"black"$normal"
|
||||
black $python_files
|
||||
end
|
||||
end
|
||||
|
||||
if set -q rust_files[1]
|
||||
if not type -q rustfmt
|
||||
echo
|
||||
echo Please install "`rustfmt`" to style rust
|
||||
echo
|
||||
if not cargo fmt --version >/dev/null
|
||||
echo
|
||||
echo $yellow'Please install "rustfmt" to style Rust, e.g. via:'
|
||||
echo "rustup component add rustfmt"$normal
|
||||
exit 127
|
||||
end
|
||||
echo === Running "$green"rustfmt"$normal"
|
||||
if set -l -q _flag_check
|
||||
if set -l -q _flag_all
|
||||
if not cargo fmt --check
|
||||
echo $red"Rust files are not formatted correctly."$normal
|
||||
exit 1
|
||||
end
|
||||
else
|
||||
echo === Running "$blue"rustfmt"$normal"
|
||||
rustfmt $rust_files
|
||||
if set -q rust_files[1]
|
||||
if not rustfmt --check --files-with-diff $rust_files
|
||||
echo $red"Rust files are not formatted correctly."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
end
|
||||
else
|
||||
if set -l -q _flag_all
|
||||
cargo fmt
|
||||
else
|
||||
if set -q rust_files[1]
|
||||
rustfmt $rust_files
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -17,20 +17,33 @@
|
||||
# - Specify the language you want to work on as an argument, which must be a file in the po/
|
||||
# directory. You can specify a language which does not have translations yet by specifying the
|
||||
# name of a file which does not yet exist. Make sure to follow the naming convention.
|
||||
# For testing:
|
||||
# - Specify `--dry-run` to see if any updates to the PO files would by applied by this script.
|
||||
# If this flag is specified, the script will exit with an error if there are outstanding
|
||||
# changes, and will display the diff. Do not specify other flags if `--dry-run` is specified.
|
||||
#
|
||||
# Specify `--use-existing-template=FILE` to prevent running cargo for extracting an up-to-date
|
||||
# version of the localized strings. This flag is intended for testing setups which make it
|
||||
# inconvenient to run cargo here, but run it in an earlier step to ensure up-to-date values.
|
||||
# This argument is passed on to the `fish_xgettext.fish` script and has no other uses.
|
||||
# `FILE` must be the path to a gettext template file generated from our compilation process.
|
||||
# It can be obtained by running:
|
||||
# set -l FILE (mktemp)
|
||||
# FISH_GETTEXT_EXTRACTION_FILE=$FILE cargo check
|
||||
|
||||
# The sort utility is locale-sensitive.
|
||||
# Ensure that sorting output is consistent by setting LC_ALL here.
|
||||
set -gx LC_ALL C.UTF-8
|
||||
|
||||
set -l build_tools (status dirname)
|
||||
set -l template_file $build_tools/../po/template.po
|
||||
set -g tmpdir
|
||||
set -l po_dir $build_tools/../po
|
||||
|
||||
set -l extract
|
||||
set -l po
|
||||
set -l mo
|
||||
|
||||
argparse --exclusive 'no-mo,only-mo' 'no-mo' 'only-mo' -- $argv
|
||||
argparse --exclusive 'no-mo,only-mo,dry-run' no-mo only-mo dry-run use-existing-template= -- $argv
|
||||
or exit $status
|
||||
|
||||
if test -z $argv[1]
|
||||
@@ -66,15 +79,52 @@ if set -l --query _flag_only_mo
|
||||
set -l --erase po
|
||||
end
|
||||
|
||||
set -g template_file (mktemp)
|
||||
# Protect from externally set $tmpdir leaking into this script.
|
||||
set -g tmpdir
|
||||
|
||||
function cleanup_exit
|
||||
set -l exit_status $status
|
||||
|
||||
rm $template_file
|
||||
|
||||
if set -g --query tmpdir[1]
|
||||
rm -r $tmpdir
|
||||
end
|
||||
|
||||
exit $exit_status
|
||||
end
|
||||
|
||||
if set -l --query extract
|
||||
$build_tools/fish_xgettext.fish >$template_file
|
||||
or exit 1
|
||||
set -l xgettext_args
|
||||
if set -l --query _flag_use_existing_template
|
||||
set xgettext_args --use-existing-template=$_flag_use_existing_template
|
||||
end
|
||||
$build_tools/fish_xgettext.fish $xgettext_args >$template_file
|
||||
or cleanup_exit
|
||||
end
|
||||
|
||||
if set -l --query _flag_dry_run
|
||||
# On a dry run, we do not modify po/ but write to a temporary directory instead and check if
|
||||
# there is a difference between po/ and the tmpdir after re-generating the PO files.
|
||||
set -g tmpdir (mktemp -d)
|
||||
|
||||
# On a dry-run, we do not update the MO files.
|
||||
set -l --erase mo
|
||||
|
||||
# Ensure tmpdir has the same initial state as the po dir.
|
||||
cp -r $po_dir/* $tmpdir
|
||||
end
|
||||
|
||||
for po_file in $po_files
|
||||
if set --query tmpdir[1]
|
||||
set po_file $tmpdir/(basename $po_file)
|
||||
end
|
||||
if set -l --query po
|
||||
if test -e $po_file
|
||||
msgmerge --update --no-fuzzy-matching --no-wrap --backup=none $po_file $template_file
|
||||
msgmerge --no-wrap --update --no-fuzzy-matching --backup=none --quiet $po_file $template_file
|
||||
and msgattrib --no-wrap --no-obsolete -o $po_file $po_file
|
||||
or cleanup_exit
|
||||
else
|
||||
cp $template_file $po_file
|
||||
end
|
||||
@@ -86,3 +136,10 @@ for po_file in $po_files
|
||||
msgfmt --check-format --output-file=$out_dir/fish.mo $po_file
|
||||
end
|
||||
end
|
||||
|
||||
if set -g --query tmpdir[1]
|
||||
diff -ur $po_dir $tmpdir
|
||||
or cleanup_exit
|
||||
end
|
||||
|
||||
cleanup_exit
|
||||
|
||||
@@ -1,92 +1,33 @@
|
||||
# This adds ctest support to the project
|
||||
enable_testing()
|
||||
|
||||
# By default, ctest runs tests serially
|
||||
# Support CTEST_PARALLEL_LEVEL as an environment variable in addition to a CMake variable
|
||||
if(NOT CTEST_PARALLEL_LEVEL)
|
||||
set(CTEST_PARALLEL_LEVEL $ENV{CTEST_PARALLEL_LEVEL})
|
||||
if(NOT CTEST_PARALLEL_LEVEL)
|
||||
include(ProcessorCount)
|
||||
ProcessorCount(CORES)
|
||||
math(EXPR halfcores "${CORES} / 2")
|
||||
set(CTEST_PARALLEL_LEVEL ${halfcores})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Put in a tests folder to reduce the top level targets in IDEs.
|
||||
set(CMAKE_FOLDER tests)
|
||||
|
||||
# We will use 125 as a reserved exit code to indicate that a test has been skipped, i.e. it did not
|
||||
# pass but it should not be considered a failed test run, either.
|
||||
set(SKIP_RETURN_CODE 125)
|
||||
|
||||
# Even though we are using CMake's ctest for testing, we still define our own `make fish_run_tests` target
|
||||
# rather than use its default for many reasons:
|
||||
# * CMake doesn't run tests in-proc or even add each tests as an individual node in the ninja
|
||||
# dependency tree, instead it just bundles all tests into a target called `test` that always just
|
||||
# shells out to `ctest`, so there are no build-related benefits to not doing that ourselves.
|
||||
# * CMake devs insist that it is appropriate for `make fish_run_tests` to never depend on `make all`, i.e.
|
||||
# running `make fish_run_tests` does not require any of the binaries to be built before testing.
|
||||
# * It is not possible to set top-level CTest options/settings such as CTEST_PARALLEL_LEVEL from
|
||||
# within the CMake configuration file.
|
||||
# * The only way to have a test depend on a binary is to add a fake test with a name like
|
||||
# "build_fish" that executes CMake recursively to build the `fish` target.
|
||||
# * Circling back to the point about individual tests not being actual Makefile targets, CMake does
|
||||
# not offer any way to execute a named test via the `make`/`ninja`/whatever interface; the only
|
||||
# way to manually invoke test `foo` is to to manually run `ctest` and specify a regex matching
|
||||
# `foo` as an argument, e.g. `ctest -R ^foo$`... which is really crazy.
|
||||
|
||||
# The top-level test target is "fish_run_tests".
|
||||
add_custom_target(fish_run_tests
|
||||
COMMAND env CTEST_PARALLEL_LEVEL=${CTEST_PARALLEL_LEVEL} FISH_FORCE_COLOR=1
|
||||
${CMAKE_CTEST_COMMAND} --force-new-ctest-process # --verbose
|
||||
--output-on-failure --progress
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper
|
||||
USES_TERMINAL
|
||||
)
|
||||
|
||||
# CMake being CMake, you can't just add a DEPENDS argument to add_test to make it depend on any of
|
||||
# your binaries actually being built before `make fish_run_tests` is executed (requiring `make all` first),
|
||||
# and the only dependency a test can have is on another test. So we make building fish
|
||||
# prerequisites to our entire top-level `test` target.
|
||||
function(add_test_target NAME)
|
||||
string(REPLACE "/" "-" NAME ${NAME})
|
||||
add_custom_target("test_${NAME}" COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -R "^${NAME}$$"
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper USES_TERMINAL)
|
||||
endfunction()
|
||||
|
||||
add_executable(fish_test_helper tests/fish_test_helper.c)
|
||||
|
||||
FILE(GLOB FISH_CHECKS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/tests/checks/*.fish)
|
||||
foreach(CHECK ${FISH_CHECKS})
|
||||
get_filename_component(CHECK_NAME ${CHECK} NAME)
|
||||
get_filename_component(CHECK ${CHECK} NAME_WE)
|
||||
add_test(NAME ${CHECK_NAME}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py --cachedir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
checks/${CHECK}.fish
|
||||
add_custom_target(
|
||||
test_${CHECK_NAME}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py ${CMAKE_CURRENT_BINARY_DIR}
|
||||
checks/${CHECK_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper
|
||||
USES_TERMINAL
|
||||
)
|
||||
set_tests_properties(${CHECK_NAME} PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
set_tests_properties(${CHECK_NAME} PROPERTIES ENVIRONMENT FISH_FORCE_COLOR=1)
|
||||
add_test_target("${CHECK_NAME}")
|
||||
endforeach(CHECK)
|
||||
|
||||
FILE(GLOB PEXPECTS CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/tests/pexpects/*.py)
|
||||
foreach(PEXPECT ${PEXPECTS})
|
||||
get_filename_component(PEXPECT ${PEXPECT} NAME)
|
||||
add_test(NAME ${PEXPECT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py --cachedir=${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
add_custom_target(
|
||||
test_${PEXPECT}
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py ${CMAKE_CURRENT_BINARY_DIR}
|
||||
pexpects/${PEXPECT}
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper
|
||||
USES_TERMINAL
|
||||
)
|
||||
set_tests_properties(${PEXPECT} PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
set_tests_properties(${PEXPECT} PROPERTIES ENVIRONMENT FISH_FORCE_COLOR=1)
|
||||
add_test_target("${PEXPECT}")
|
||||
endforeach(PEXPECT)
|
||||
|
||||
set(cargo_test_flags)
|
||||
# Rust stuff.
|
||||
set(cargo_test_flags)
|
||||
if(DEFINED ASAN)
|
||||
# Rust w/ -Zsanitizer=address requires explicitly specifying the --target triple or else linker
|
||||
# errors pertaining to asan symbols will ensue.
|
||||
@@ -107,10 +48,17 @@ if(DEFINED Rust_CARGO_TARGET)
|
||||
list(APPEND cargo_test_flags "--lib")
|
||||
endif()
|
||||
|
||||
add_test(
|
||||
NAME "cargo-test"
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test --no-default-features ${CARGO_FLAGS} --workspace --target-dir ${rust_target_dir} ${cargo_test_flags}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
set(max_concurrency_flag)
|
||||
if(DEFINED ENV{FISH_TEST_MAX_CONCURRENCY})
|
||||
list(APPEND max_concurrency_flag "--max-concurrency" $ENV{FISH_TEST_MAX_CONCURRENCY})
|
||||
endif()
|
||||
|
||||
# The top-level test target is "fish_run_tests".
|
||||
add_custom_target(fish_run_tests
|
||||
# TODO: This should be replaced with a unified solution, possibly build_tools/check.sh.
|
||||
COMMAND ${CMAKE_SOURCE_DIR}/tests/test_driver.py ${max_concurrency_flag} ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMAND env ${VARS_FOR_CARGO} cargo test --no-default-features ${CARGO_FLAGS} --workspace --target-dir ${rust_target_dir} ${cargo_test_flags}
|
||||
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
|
||||
DEPENDS fish fish_indent fish_key_reader fish_test_helper
|
||||
USES_TERMINAL
|
||||
)
|
||||
set_tests_properties("cargo-test" PROPERTIES SKIP_RETURN_CODE ${SKIP_RETURN_CODE})
|
||||
add_test_target("cargo-test")
|
||||
|
||||
@@ -8,7 +8,7 @@ Synopsis
|
||||
|
||||
.. synopsis::
|
||||
|
||||
fish_git_prompt
|
||||
fish_git_prompt [FORMAT]
|
||||
|
||||
::
|
||||
|
||||
@@ -24,6 +24,8 @@ The ``fish_git_prompt`` function displays information about the current git repo
|
||||
|
||||
`Git <https://git-scm.com>`_ must be installed.
|
||||
|
||||
It is possible to modify the output format by passing an argument. The default value is ``" (%s)"``.
|
||||
|
||||
There are numerous customization options, which can be controlled with git options or fish variables. git options, where available, take precedence over the fish variable with the same function. git options can be set on a per-repository or global basis. git options can be set with the ``git config`` command, while fish variables can be set as usual with the :doc:`set <set>` command.
|
||||
|
||||
Boolean options (those which enable or disable something) understand "1", "yes" or "true" to mean true and every other value to mean false.
|
||||
|
||||
@@ -13,7 +13,7 @@ Synopsis
|
||||
path extension GENERAL_OPTIONS [PATH ...]
|
||||
path filter GENERAL_OPTIONS [-v | --invert]
|
||||
[-d] [-f] [-l] [-r] [-w] [-x]
|
||||
[(-t | --type) TYPE] [(-p | --perm) PERMISSION] [PATH ...]
|
||||
[(-t | --type) TYPE] [(-p | --perm) PERMISSION] [--all] [PATH ...]
|
||||
path is GENERAL_OPTIONS [(-v | --invert)] [(-t | --type) TYPE]
|
||||
[-d] [-f] [-l] [-r] [-w] [-x]
|
||||
[(-p | --perm) PERMISSION] [PATH ...]
|
||||
@@ -22,7 +22,7 @@ Synopsis
|
||||
path resolve GENERAL_OPTIONS [PATH ...]
|
||||
path change-extension GENERAL_OPTIONS EXTENSION [PATH ...]
|
||||
path sort GENERAL_OPTIONS [-r | --reverse]
|
||||
[-u | --unique] [--key=basename|dirname|path] [PATH ...]
|
||||
[-u | --unique] [--key=(basename | dirname | path)] [PATH ...]
|
||||
|
||||
GENERAL_OPTIONS
|
||||
[-z | --null-in] [-Z | --null-out] [-q | --quiet]
|
||||
@@ -148,7 +148,7 @@ Examples
|
||||
> echo $path$extension
|
||||
# reconstructs the original path again.
|
||||
./foo.mp4
|
||||
|
||||
|
||||
.. _cmd-path-filter:
|
||||
|
||||
"filter" subcommand
|
||||
@@ -158,7 +158,7 @@ Examples
|
||||
|
||||
path filter [-z | --null-in] [-Z | --null-out] [-q | --quiet] \
|
||||
[-d] [-f] [-l] [-r] [-w] [-x] \
|
||||
[-v | --invert] [(-t | --type) TYPE] [(-p | --perm) PERMISSION] [PATH ...]
|
||||
[-v | --invert] [(-t | --type) TYPE] [(-p | --perm) PERMISSION] [--all] [PATH ...]
|
||||
|
||||
``path filter`` returns all of the given paths that match the given checks. In all cases, the paths need to exist, nonexistent paths are always filtered.
|
||||
|
||||
@@ -180,6 +180,10 @@ When a path starts with ``-``, ``path filter`` will prepend ``./`` to avoid it b
|
||||
|
||||
It returns 0 if at least one path passed the filter.
|
||||
|
||||
With ``--all``, return status 0 (true) if all paths pass the filter, and status 1 (false) if any path fails. This is equivalent to ``not path filter -v``. It produces no output, only a status.
|
||||
|
||||
When ``--all`` combined with ``--invert``, it returns status 0 (true) if all paths fail the filter and status 1 (false) if any path passes.
|
||||
|
||||
``path is`` is shorthand for ``path filter -q``, i.e. just checking without producing output, see :ref:`The is subcommand <cmd-path-is>`.
|
||||
|
||||
Examples
|
||||
@@ -211,6 +215,9 @@ Examples
|
||||
>_ path filter -fx $PATH/*
|
||||
# Prints all possible commands - the first entry of each name is what fish would execute!
|
||||
|
||||
>_ path filter --all /usr/bin /usr/argagagji
|
||||
# This returns 1 (false) because not all paths pass the filter.
|
||||
|
||||
.. _cmd-path-is:
|
||||
|
||||
"is" subcommand
|
||||
|
||||
@@ -362,7 +362,7 @@ Some bindings are common across Emacs and vi mode, because they aren't text edit
|
||||
|
||||
- :kbd:`alt-v` Same as :kbd:`alt-e`.
|
||||
|
||||
- :kbd:`alt-s` Prepends ``sudo`` to the current commandline. If the commandline is empty, prepend ``sudo`` to the last commandline.
|
||||
- :kbd:`alt-s` Prepends ``sudo`` to the current commandline. If the commandline is empty, prepend ``sudo`` to the last commandline. If ``sudo`` is not installed, various similar commands are tried: ``doas``, ``please``, and ``run0``.
|
||||
|
||||
- :kbd:`ctrl-space` Inserts a space without expanding an :ref:`abbreviation <abbreviations>`. For vi mode, this only applies to insert-mode.
|
||||
|
||||
@@ -507,7 +507,13 @@ Command mode is also known as normal mode.
|
||||
|
||||
- :kbd:`backspace` moves the cursor left.
|
||||
|
||||
- :kbd:`g` / :kbd:`G` moves the cursor to the beginning/end of the commandline, respectively.
|
||||
- :kbd:`g,g` / :kbd:`G` moves the cursor to the beginning/end of the commandline, respectively.
|
||||
|
||||
- :kbd:`~` toggles the case (upper/lower) of the character and moves to the next character.
|
||||
|
||||
- :kbd:`g,u` lowercases to the end of the word.
|
||||
|
||||
- :kbd:`g,U` uppercases to the end of the word.
|
||||
|
||||
- :kbd:`:,q` exits fish.
|
||||
|
||||
@@ -551,6 +557,10 @@ Visual mode
|
||||
|
||||
- :kbd:`~` toggles the case (upper/lower) on the selection, and enters :ref:`command mode <vi-mode-command>`.
|
||||
|
||||
- :kbd:`g,u` lowercases the selection, and enters :ref:`command mode <vi-mode-command>`.
|
||||
|
||||
- :kbd:`g,U` uppercases the selection, and enters :ref:`command mode <vi-mode-command>`.
|
||||
|
||||
- :kbd:`",*,y` copies the selection to the clipboard, and enters :ref:`command mode <vi-mode-command>`.
|
||||
|
||||
.. _custom-binds:
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
FROM alpine:3.19
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apk add --no-cache \
|
||||
bash \
|
||||
cargo \
|
||||
cmake \
|
||||
g++ \
|
||||
gettext-dev \
|
||||
git \
|
||||
libintl \
|
||||
musl-dev \
|
||||
ninja \
|
||||
pcre2-dev \
|
||||
py3-pexpect \
|
||||
python3 \
|
||||
@@ -40,4 +38,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -8,17 +8,13 @@ RUN cd /etc/yum.repos.d/ && \
|
||||
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
|
||||
|
||||
|
||||
# install powertools to get ninja-build
|
||||
RUN dnf -y install dnf-plugins-core \
|
||||
&& dnf config-manager --set-enabled powertools \
|
||||
&& yum install --assumeyes epel-release \
|
||||
&& yum install --assumeyes \
|
||||
cargo \
|
||||
cmake \
|
||||
diffutils \
|
||||
gcc-c++ \
|
||||
git \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
openssl \
|
||||
@@ -39,4 +35,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -5,22 +5,34 @@ set -e
|
||||
# This script is copied into the root directory of our Docker tests.
|
||||
# It is the entry point for running Docker-based tests.
|
||||
|
||||
cd ~/fish-build
|
||||
echo build_tools/check.sh >>~/.bash_history
|
||||
|
||||
cd /fish-source
|
||||
git config --global --add safe.directory /fish-source
|
||||
cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug /fish-source "$@"
|
||||
|
||||
export CARGO_TARGET_DIR="$HOME"/fish-build
|
||||
|
||||
interactive_shell() {
|
||||
echo
|
||||
echo "+ export=CARGO_TARGET_DIR=$CARGO_TARGET_DIR"
|
||||
echo
|
||||
bash -i
|
||||
}
|
||||
|
||||
# Spawn a shell if FISH_RUN_SHELL_BEFORE_TESTS is set.
|
||||
if test -n "$FISH_RUN_SHELL_BEFORE_TESTS"
|
||||
then
|
||||
bash -i
|
||||
interactive_shell
|
||||
fi
|
||||
|
||||
(set +e; ninja && ninja fish_run_tests)
|
||||
set +e
|
||||
build_tools/check.sh
|
||||
RES=$?
|
||||
set -e
|
||||
|
||||
# Drop the user into a shell if FISH_RUN_SHELL_AFTER_TESTS is set.
|
||||
if test -n "$FISH_RUN_SHELL_AFTER_TESTS"; then
|
||||
bash -i
|
||||
interactive_shell
|
||||
fi
|
||||
|
||||
exit $RES
|
||||
|
||||
@@ -4,8 +4,9 @@ usage() {
|
||||
cat << EOF
|
||||
Usage: $(basename "$0") [--shell-before] [--shell-after] DOCKERFILE
|
||||
Options:
|
||||
--shell-before Before the tests start, run a bash shell
|
||||
--shell-after After the tests end, run a bash shell
|
||||
--shell-before Before the tests start, run a bash shell
|
||||
--shell-after After the tests end, run a bash shell
|
||||
--lint, --no-lint Enable/disable linting and failure on warnings
|
||||
EOF
|
||||
exit 1
|
||||
}
|
||||
@@ -29,6 +30,12 @@ while [ $# -gt 1 ]; do
|
||||
--shell-after)
|
||||
DOCKER_EXTRA_ARGS="$DOCKER_EXTRA_ARGS --env FISH_RUN_SHELL_AFTER_TESTS=1"
|
||||
;;
|
||||
--lint)
|
||||
DOCKER_EXTRA_ARGS="$DOCKER_EXTRA_ARGS --env FISH_CHECK_LINT=true"
|
||||
;;
|
||||
--no-lint)
|
||||
DOCKER_EXTRA_ARGS="$DOCKER_EXTRA_ARGS --env FISH_CHECK_LINT=false"
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
|
||||
@@ -2,11 +2,9 @@ FROM fedora:latest
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
RUN dnf install --assumeyes \
|
||||
cmake \
|
||||
diffutils \
|
||||
gcc-c++ \
|
||||
git-core \
|
||||
ninja-build \
|
||||
pcre2-devel \
|
||||
python3 \
|
||||
python3-pip \
|
||||
@@ -28,4 +26,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
FROM ubuntu:20.04
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV CFLAGS="-m32"
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
g++-multilib \
|
||||
gettext \
|
||||
git \
|
||||
locales \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
@@ -38,6 +35,13 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV \
|
||||
CFLAGS=-m32 \
|
||||
PCRE2_SYS_STATIC=1 \
|
||||
FISH_CHECK_TARGET_TRIPLE=i686-unknown-linux-gnu
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& rustup target add i686-unknown-linux-gnu \
|
||||
&& /fish_run_tests.sh -DFISH_USE_SYSTEM_PCRE2=OFF -DRust_CARGO_TARGET=i686-unknown-linux-gnu
|
||||
&& rustup target add ${FISH_CHECK_TARGET_TRIPLE} \
|
||||
&& /fish_run_tests.sh
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
FROM arm64v8/ubuntu:focal
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rustc \
|
||||
@@ -36,4 +34,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
FROM ubuntu:20.04
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
gettext \
|
||||
git \
|
||||
locales \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
@@ -35,4 +33,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
FROM arm32v7/ubuntu:jammy
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
file \
|
||||
g++ \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
@@ -38,4 +36,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
FROM ubuntu:jammy
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
sudo \
|
||||
@@ -42,12 +40,17 @@ COPY fish_run_tests.sh /
|
||||
ENV \
|
||||
RUSTFLAGS=-Zsanitizer=address \
|
||||
RUSTDOCFLAGS=-Zsanitizer=address \
|
||||
FISH_CHECK_CARGO_ARGS='-Zbuild-std --features=tsan' \
|
||||
FISH_CHECK_TARGET_TRIPLE=x86_64-unknown-linux-gnu \
|
||||
FISH_CI_SAN=1 \
|
||||
FISH_TEST_MAX_CONCURRENCY=4 \
|
||||
CC=clang \
|
||||
CXX=clang++ \
|
||||
ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:detect_leaks=1 \
|
||||
LSAN_OPTIONS=verbosity=0:log_threads=0:use_tls=1:print_suppressions=0:suppressions=/fish-source/build_tools/lsan_suppressions.txt \
|
||||
FISH_CI_SAN=1
|
||||
LSAN_OPTIONS=verbosity=0:log_threads=0:use_tls=1:print_suppressions=0:suppressions=/fish-source/build_tools/lsan_suppressions.txt
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$(cat /.llvm-version) \
|
||||
/fish_run_tests.sh -DASAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu
|
||||
&& ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$(cat /.llvm-version) \
|
||||
&& /fish_run_tests.sh
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
FROM ubuntu:jammy
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
sudo \
|
||||
@@ -39,7 +37,11 @@ COPY fish_run_tests.sh /
|
||||
ENV \
|
||||
RUSTFLAGS=-Zsanitizer=thread \
|
||||
RUSTDOCFLAGS=-Zsanitizer=thread \
|
||||
FISH_CI_SAN=1
|
||||
FISH_CHECK_CARGO_ARGS='-Zbuild-std --features=tsan' \
|
||||
FISH_CHECK_TARGET_TRIPLE=x86_64-unknown-linux-gnu \
|
||||
FISH_CI_SAN=1 \
|
||||
FISH_TEST_MAX_CONCURRENCY=4
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& /fish_run_tests.sh -DTSAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env && /fish_run_tests.sh
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
FROM ubuntu:jammy
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cargo \
|
||||
cmake \
|
||||
clang \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
rustc \
|
||||
@@ -35,4 +33,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
|
||||
@@ -1,18 +1,16 @@
|
||||
FROM ubuntu:noble
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get -y install \
|
||||
build-essential \
|
||||
cmake \
|
||||
gettext \
|
||||
git \
|
||||
libpcre2-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pexpect \
|
||||
tmux \
|
||||
@@ -36,5 +34,7 @@ RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup.sh \
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD . ~/.cargo/env \
|
||||
&& /fish_run_tests.sh
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
FROM opensuse/tumbleweed:latest
|
||||
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
|
||||
|
||||
ENV LANG C.UTF-8
|
||||
ENV LC_ALL C.UTF-8
|
||||
ENV LANG=C.UTF-8
|
||||
ENV LC_ALL=C.UTF-8
|
||||
|
||||
RUN zypper --non-interactive install \
|
||||
bash \
|
||||
cmake \
|
||||
diffutils \
|
||||
gcc-c++ \
|
||||
git-core \
|
||||
ninja \
|
||||
pcre2-devel \
|
||||
python311 \
|
||||
python311-pip \
|
||||
@@ -35,4 +33,6 @@ WORKDIR /home/fishuser
|
||||
|
||||
COPY fish_run_tests.sh /
|
||||
|
||||
ENV FISH_CHECK_LINT=false
|
||||
|
||||
CMD /fish_run_tests.sh
|
||||
16
gettext-extraction/Cargo.toml
Normal file
16
gettext-extraction/Cargo.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "fish-gettext-extraction"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
version = "0.0.1"
|
||||
repository.workspace = true
|
||||
description = "proc-macro for extracting strings for gettext translation"
|
||||
|
||||
[lib]
|
||||
proc-macro = true
|
||||
|
||||
[dependencies]
|
||||
proc-macro2 = "1.0"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
67
gettext-extraction/src/lib.rs
Normal file
67
gettext-extraction/src/lib.rs
Normal file
@@ -0,0 +1,67 @@
|
||||
extern crate proc_macro;
|
||||
use proc_macro::TokenStream;
|
||||
use std::{ffi::OsString, fs::OpenOptions, io::Write};
|
||||
|
||||
fn append_po_entry_to_file(message: &TokenStream, file_name: &OsString) {
|
||||
let mut file = OpenOptions::new()
|
||||
.create(true)
|
||||
.append(true)
|
||||
.open(file_name)
|
||||
.unwrap_or_else(|e| panic!("Could not open file {file_name:?}: {e}"));
|
||||
let message_string = message.to_string();
|
||||
if message_string.contains('\n') {
|
||||
panic!("Gettext strings may not contain unescaped newlines. Unescaped newline found in '{message_string}'")
|
||||
}
|
||||
// Crude check for format strings. This might result in false positives.
|
||||
let format_string_annotation = if message_string.contains('%') {
|
||||
"#, c-format\n"
|
||||
} else {
|
||||
""
|
||||
};
|
||||
let po_entry = format!("{format_string_annotation}msgid {message_string}\nmsgstr \"\"\n\n");
|
||||
file.write_all(po_entry.as_bytes()).unwrap();
|
||||
}
|
||||
|
||||
/// The `message` is passed through unmodified.
|
||||
/// If `FISH_GETTEXT_EXTRACTION_FILE` is defined in the environment,
|
||||
/// this file is used to write the message,
|
||||
/// so that it can then be used for generating gettext PO files.
|
||||
/// The `message` must be a string literal.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// This macro panics if the `FISH_GETTEXT_EXTRACTION_FILE` variable is set and `message` has an
|
||||
/// unexpected format.
|
||||
/// Note that for example `concat!(...)` cannot be passed to this macro, because expansion works
|
||||
/// outside in, meaning this macro would still see the `concat!` macro invocation, instead of a
|
||||
/// string literal.
|
||||
#[proc_macro]
|
||||
pub fn gettext_extract(message: TokenStream) -> TokenStream {
|
||||
if let Some(file_path) = std::env::var_os("FISH_GETTEXT_EXTRACTION_FILE") {
|
||||
let pm2_message = proc_macro2::TokenStream::from(message.clone());
|
||||
let mut token_trees = pm2_message.into_iter();
|
||||
let first_token = token_trees
|
||||
.next()
|
||||
.expect("gettext_extract got empty token stream. Expected one token.");
|
||||
if token_trees.next().is_some() {
|
||||
panic!("Invalid number of tokens passed to gettext_extract. Expected one token, but got more.")
|
||||
}
|
||||
if let proc_macro2::TokenTree::Group(group) = first_token {
|
||||
let mut group_tokens = group.stream().into_iter();
|
||||
let first_group_token = group_tokens
|
||||
.next()
|
||||
.expect("gettext_extract expected one group token but got none.");
|
||||
if group_tokens.next().is_some() {
|
||||
panic!("Invalid number of tokens in group passed to gettext_extract. Expected one token, but got more.")
|
||||
}
|
||||
if let proc_macro2::TokenTree::Literal(_) = first_group_token {
|
||||
append_po_entry_to_file(&message, &file_path);
|
||||
} else {
|
||||
panic!("Expected literal in gettext_extract, but got: {first_group_token:?}");
|
||||
}
|
||||
} else {
|
||||
panic!("Expected group in gettext_extract, but got: {first_token:?}");
|
||||
}
|
||||
}
|
||||
message
|
||||
}
|
||||
2056
po/pt_BR.po
2056
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
5666
po/zh_CN.po
5666
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ name = "fish-printf"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
version = "0.2.1"
|
||||
repository = "https://github.com/fish-shell/fish-shell"
|
||||
repository.workspace = true
|
||||
description = "printf implementation, based on musl"
|
||||
license = "MIT"
|
||||
|
||||
|
||||
@@ -279,6 +279,7 @@ fn format_a(mut y: f64, params: FormatParams<'_, impl Write>) -> Result<usize, E
|
||||
|
||||
// Compute the number of hex digits in the mantissa after the decimal.
|
||||
// -1 for leading 1 bit (we are to the range [1, 2)), then divide by 4, rounding up.
|
||||
#[allow(unknown_lints)] // for old clippy
|
||||
#[allow(clippy::manual_div_ceil)]
|
||||
const MANTISSA_HEX_DIGITS: usize = (MANTISSA_BITS - 1 + 3) / 4;
|
||||
if had_prec && prec < MANTISSA_HEX_DIGITS {
|
||||
@@ -495,7 +496,7 @@ fn format_mantissa_e(
|
||||
let digit = if d < decimal.len_i32() { decimal[d] } else { 0 };
|
||||
let min_width = if d > 0 { DIGIT_WIDTH } else { 1 };
|
||||
buf.clear();
|
||||
write!(buf, "{:0width$}", digit, width = min_width)?;
|
||||
write!(buf, "{digit:0min_width$}")?;
|
||||
let mut s = buf.as_str();
|
||||
if d == 0 {
|
||||
// First digit. Emit it, and likely also a decimal point.
|
||||
|
||||
@@ -464,7 +464,7 @@ pub fn sprintf_locale(
|
||||
let uint = arg.as_uint()?;
|
||||
if uint != 0 {
|
||||
prefix = "0x";
|
||||
write!(buf, "{:x}", uint)?;
|
||||
write!(buf, "{uint:x}")?;
|
||||
}
|
||||
buf
|
||||
}
|
||||
@@ -478,9 +478,9 @@ pub fn sprintf_locale(
|
||||
prefix = if lower { "0x" } else { "0X" };
|
||||
}
|
||||
if lower {
|
||||
write!(buf, "{:x}", uint)?;
|
||||
write!(buf, "{uint:x}")?;
|
||||
} else {
|
||||
write!(buf, "{:X}", uint)?;
|
||||
write!(buf, "{uint:X}")?;
|
||||
}
|
||||
}
|
||||
buf
|
||||
@@ -488,7 +488,7 @@ pub fn sprintf_locale(
|
||||
CS::o => {
|
||||
let uint = arg.as_uint()?;
|
||||
if uint != 0 {
|
||||
write!(buf, "{:o}", uint)?;
|
||||
write!(buf, "{uint:o}")?;
|
||||
}
|
||||
if flags.alt_form && desired_precision.unwrap_or(0) <= buf.len() + 1 {
|
||||
desired_precision = Some(buf.len() + 1);
|
||||
@@ -498,7 +498,7 @@ pub fn sprintf_locale(
|
||||
CS::u => {
|
||||
let uint = arg.as_uint()?;
|
||||
if uint != 0 {
|
||||
write!(buf, "{}", uint)?;
|
||||
write!(buf, "{uint}")?;
|
||||
}
|
||||
buf
|
||||
}
|
||||
|
||||
@@ -890,7 +890,7 @@ fn test_exhaustive(rust_fmt: &str, c_fmt: *const c_char) {
|
||||
// "There's only 4 billion floats so test them all."
|
||||
// This tests a format string expected to be of the form "%.*g" or "%.*e".
|
||||
// That is, it takes a precision and a double.
|
||||
println!("Testing {}", rust_fmt);
|
||||
println!("Testing {rust_fmt}");
|
||||
let mut rust_str = String::with_capacity(128);
|
||||
let mut c_storage = [0u8; 128];
|
||||
let c_storage_ptr = c_storage.as_mut_ptr() as *mut c_char;
|
||||
|
||||
@@ -195,6 +195,7 @@ complete -n '__fish_seen_subcommand_from sideload' -c adb -k -xa '(__fish_comple
|
||||
complete -n '__fish_seen_subcommand_from reconnect' -c adb -x -a device -d 'Kick current connection from device side and make it reconnect.'
|
||||
|
||||
# commands that accept listing device files
|
||||
complete -n '__fish_seen_subcommand_from exec-out' -c adb -f -a "(__fish_adb_list_files)" -d 'File on device'
|
||||
complete -n '__fish_seen_subcommand_from shell' -c adb -f -a "(__fish_adb_list_files)" -d 'File on device'
|
||||
complete -n '__fish_seen_subcommand_from pull' -c adb -F -a "(__fish_adb_list_files)" -d 'File on device'
|
||||
complete -n '__fish_seen_subcommand_from push' -c adb -ka "(__fish_adb_list_files)" -d 'File on device'
|
||||
|
||||
1
share/completions/cilium.fish
Normal file
1
share/completions/cilium.fish
Normal file
@@ -0,0 +1 @@
|
||||
cilium completion fish 2>/dev/null | source
|
||||
102
share/completions/cjpm.fish
Normal file
102
share/completions/cjpm.fish
Normal file
@@ -0,0 +1,102 @@
|
||||
# cjpm.fish - Fish completion script for Cangjie Package Manager
|
||||
|
||||
# Global options
|
||||
complete -c cjpm -l help -s h -d "Help for cjpm"
|
||||
complete -c cjpm -l version -s v -d "Version for cjpm"
|
||||
|
||||
# Subcommands
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a init -d "Init a new cangjie module"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a check -d "Check the dependencies"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a update -d "Update cjpm.lock"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a tree -d "Display the package dependencies in the source code"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a build -d "Compile the current module"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a run -d "Compile and run an executable product"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a test -d "Unittest a local package or module"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a bench -d "Run benchmarks in a local package or module"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a clean -d "Clean up the target directory"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a install -d "Install a cangjie binary"
|
||||
complete -c cjpm -n __fish_use_subcommand -f -a uninstall -d "Uninstall a cangjie binary"
|
||||
|
||||
# 'init' subcommand options
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from init" -f -l help -s h -d "Help for init"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from init" -f -l workspace -d "Initialize a workspace's default configuration file"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from init" -f -l name -d "Specify root package name (default: current directory)" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from init" -l path -d "Specify path to create the module (default: current directory)" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from init" -f -l type -d "Define output type of current module" -r -f -a "executable static dynamic"
|
||||
|
||||
# 'run' subcommand options
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -l name -d "Name of the executable product to run (default: main)" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -l build-args -d "Arguments to pass to the build process" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -l skip-build -d "Skip compile, only run the executable product"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -l run-args -d "Arguments to pass to the executable product" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -l target-dir -d "Specify target directory" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -s g -d "Enable debug version"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -s h -l help -d "Help for run"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -s V -l verbose -d "Enable verbose"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from run" -f -l skip-script -d "Disable script 'build.cj'"
|
||||
|
||||
# 'install' subcommand options
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -s h -l help -d "Help for install"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -s V -l verbose -d "Enable verbose"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -s m -l member -d "Specify a member module of the workspace" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -s g -d "Enable install debug version target"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -l path -d "Specify path of source module (default: current path)" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -l root -d "Specify path of installed binary" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l git -d "Specify URL of installed git module" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l branch -d "Specify branch of installed git module" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l tag -d "Specify tag of installed git module" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l commit -d "Specify commit ID of installed git module" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -s j -l jobs -d "Number of jobs to spawn in parallel" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l cfg -d "Enable the customized option 'cfg'"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -l target-dir -d "Specify target directory" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l name -d "Specify product name to install (default: all)" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l skip-build -d "Install binary in target directory without building"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l list -d "List all installed modules and their versions"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from install" -f -l skip-script -d "Disable script 'build.cj'"
|
||||
|
||||
# 'build' subcommand options
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s h -l help -d "Help for build"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s i -l incremental -d "Enable incremental compilation"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s j -l jobs -d "Number of jobs to spawn in parallel" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s V -l verbose -d "Enable verbose"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s g -d "Enable compile debug version target"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -l coverage -d "Enable coverage"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -l cfg -d "Enable the customized option 'cfg'"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s m -l member -d "Specify a member module of the workspace" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -l target -d "Generate code for the given target platform" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -l target-dir -d "Specify target directory" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s o -l output -d "Specify product name when compiling an executable file" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -s l -l lint -d "Enable cjlint code check"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -l mock -d "Enable support of mocking classes in tests"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from build" -f -l skip-script -d "Disable script 'build.cj'"
|
||||
|
||||
# 'test' subcommand options
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -s h -l help -d "Help for test"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -s j -l jobs -d "Number of jobs to spawn in parallel" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -s V -l verbose -d "Enable verbose"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -s g -d "Enable compile debug version tests"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -s i -l incremental -d "Enable incremental compilation"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l no-run -d "Compile, but don't run tests"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l skip-build -d "Skip compile, only run tests"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l coverage -d "Enable coverage"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l cfg -d "Enable the customized option 'cfg'"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l module -d "Specify modules to test (default: current module)" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -s m -l member -d "Specify a member module of the workspace" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l target -d "Unittest for the given target platform" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -l target-dir -d "Specify target directory" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l dry-run -d "Print tests without execution"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l filter -d "Enable filter test" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l include-tags -d "Run tests with specified tags" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l exclude-tags -d "Run tests without specified tags" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l no-color -d "Enable colorless result output"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l random-seed -d "Enable random seed" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l timeout-each -d "Specify default timeout for test cases" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l parallel -d "Number of workers running tests" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l show-all-output -d "Show output for all test cases"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l no-capture-output -d "Disable test output capturing"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -l report-path -d "Specify path to directory of report" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l report-format -d "Specify format of report" -r
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l skip-script -d "Disable script 'build.cj'"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l no-progress -d "Disable progress report"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l progress-brief -d "Display brief progress report"
|
||||
complete -c cjpm -n "__fish_seen_subcommand_from test" -f -l progress-entries-limit -d "Limit number of entries shown in progress report"
|
||||
@@ -49,10 +49,10 @@ function __fish_clj_tools -V bb_helper
|
||||
bb -e "$bb_helper" tools
|
||||
end
|
||||
|
||||
complete -c clj -s X -x -r -k -a "(__fish_complete_list : __fish_clj_aliases)" -d "Use concatenated aliases to modify classpath or supply exec fn/args"
|
||||
complete -c clj -s A -x -r -k -a "(__fish_complete_list : __fish_clj_aliases)" -d "Use concatenated aliases to modify classpath"
|
||||
complete -c clj -s M -x -r -k -a "(__fish_complete_list : __fish_clj_aliases)" -d "Use concatenated aliases to modify classpath or supply main opts"
|
||||
complete -c clj -s T -x -r -k -a "(__fish_complete_list : __fish_clj_tools)" -d "Invoke tool by name or via aliases ala -X"
|
||||
complete -c clj -s X -x -r -k -a "(__fish_stripprefix='^-\w*X' __fish_complete_list : __fish_clj_aliases)" -d "Use concatenated aliases to modify classpath or supply exec fn/args"
|
||||
complete -c clj -s A -x -r -k -a "(__fish_stripprefix='^-\w*A' __fish_complete_list : __fish_clj_aliases)" -d "Use concatenated aliases to modify classpath"
|
||||
complete -c clj -s M -x -r -k -a "(__fish_stripprefix='^-\w*M' __fish_complete_list : __fish_clj_aliases)" -d "Use concatenated aliases to modify classpath or supply main opts"
|
||||
complete -c clj -s T -x -r -k -a "(__fish_stripprefix='^-\w*T' __fish_complete_list : __fish_clj_tools)" -d "Invoke tool by name or via aliases ala -X"
|
||||
|
||||
complete -c clj -f -o Sdeps -r -d "Deps data to use as the last deps file to be merged"
|
||||
complete -c clj -f -o Spath -d "Compute classpath and echo to stdout only"
|
||||
|
||||
45
share/completions/cpan.fish
Normal file
45
share/completions/cpan.fish
Normal file
@@ -0,0 +1,45 @@
|
||||
# fish completion for Perl's cpan
|
||||
|
||||
function __fish_cpan_list_installed_modules
|
||||
# Following IRC's #fish suggestion to use </dev/null as cpan might go interactive
|
||||
cpan -l </dev/null | while read -l line
|
||||
# Filter out unrelated messages or notifications
|
||||
if string match -qr -- '^\w.*\t\w.*$' $line
|
||||
string replace -r -- '\t.*' '' $line |
|
||||
string escape --style=script
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
complete -c cpan -s a -d "Creates a CPAN.pm autobundle with CPAN::Shell->autobundle"
|
||||
complete -c cpan -s A -d "Show primary maintainer for specified module" -xa "(__fish_cpan_list_installed_modules)"
|
||||
complete -c cpan -s c -d "Runs a `make clean` in the specified modules directories"
|
||||
complete -c cpan -s C -d "Show the Changes files for specified module" -a "(__fish_cpan_list_installed_modules)"
|
||||
complete -c cpan -s D -d "Show module details" -a "(__fish_cpan_list_installed_modules)"
|
||||
complete -c cpan -s f -d "Force the specified action"
|
||||
complete -c cpan -s F -d "Turn off CPAN.pm's attempts to lock anything"
|
||||
complete -c cpan -s g -d "Download latest distribution of module to current directory" -a "(__fish_cpan_list_installed_modules)"
|
||||
# complete -c cpan -s G -d "UNIMPLEMENTED"
|
||||
complete -c cpan -s h -d "Print a help message and exit"
|
||||
complete -c cpan -s i -d "Install specified module"
|
||||
complete -c cpan -s I -d "Load 'local::lib' (think like '-I' for loading lib paths)"
|
||||
complete -c cpan -s j -d "Load file with CPAN configuration data"
|
||||
complete -c cpan -s J -d "Dump the configuration in the same format that CPAN.pm uses"
|
||||
complete -c cpan -s l -d "list all installed modules with their versions"
|
||||
complete -c cpan -s L -d "List the modules by the specified authors"
|
||||
complete -c cpan -s m -d "Make the specified modules"
|
||||
complete -c cpan -s M -d "Comma-separated list of mirrors to use for this run" -x
|
||||
#complete -c cpan -s n -d "Do a dry run, but dont actually install anything. (unimplemented)"
|
||||
complete -c cpan -s O -d "Show the out-of-date modules"
|
||||
complete -c cpan -s p -d "Ping the configured mirrors and print a report"
|
||||
complete -c cpan -s P -d "Find and the best mirrors available"
|
||||
complete -c cpan -s r -d "Recompiles dynamically loaded modules with CPAN::Shell->recompile"
|
||||
complete -c cpan -s s -d "Drop in the CPAN.pm shell"
|
||||
complete -c cpan -s t -d "Run a `make test` on the specified modules"
|
||||
complete -c cpan -s T -d "Do not test modules. Simply install them"
|
||||
complete -c cpan -s u -d "Upgrade all installed modules"
|
||||
complete -c cpan -s v -d "Print the script version and CPAN.pm version then exit"
|
||||
complete -c cpan -s V -d "Print detailed information about the cpan client"
|
||||
# complete -c cpan -s w -d "UNIMPLEMENTED"
|
||||
complete -c cpan -s x -d "Find close matches to named module. Requires Text::Levenshtein or others"
|
||||
complete -c cpan -s X -d "Dump all the namespaces to standard output"
|
||||
@@ -85,7 +85,7 @@ complete -c equery -n '__fish_seen_subcommand_from f files' -s s -l timestamp -d
|
||||
complete -c equery -n '__fish_seen_subcommand_from f files' -s t -l type -d "Include file type in output"
|
||||
complete -c equery -n '__fish_seen_subcommand_from f files' -l tree -d "Display results in a tree"
|
||||
complete -c equery -n '__fish_seen_subcommand_from f files' -s f -l filter -d "Filter output by file type" \
|
||||
-xa "(__fish_complete_list , __fish_equery_files_filter_args)"
|
||||
-xa "(__fish_stripprefix='^(--filter=|-\w*f)' __fish_complete_list , __fish_equery_files_filter_args)"
|
||||
|
||||
# has + hasuse
|
||||
complete -c equery -n '__fish_seen_subcommand_from a has h hasuse' -s I -l exclude-installed -d "Exclude installed pkgs from search path"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
complete -c fish_indent -s h -l help -d 'Display help and exit'
|
||||
complete -c fish_indent -s v -l version -d 'Display version and exit'
|
||||
complete -c fish_indent -s c -l check -d 'Do not indent, only return 0 if the code is already indented as fish_indent would'
|
||||
complete -c fish_indent -s i -l no-indent -d 'Do not indent output, only reformat into one job per line'
|
||||
complete -c fish_indent -l only-indent -d 'Do not reformat, only indent lines'
|
||||
complete -c fish_indent -l only-unindent -d 'Do not reformat, only unindent lines'
|
||||
|
||||
@@ -58,29 +58,12 @@ function __fish_flatpak
|
||||
flatpak $argv | string replace -rf '^([^A-Z].*?)(?: +|\t)(.*?)\s*$' '$1\t$2'
|
||||
end
|
||||
|
||||
function __fish_print_flatpak_packages
|
||||
set -l xdg_cache_home (__fish_make_cache_dir)
|
||||
or return
|
||||
set -l cache_file $xdg_cache_home/flatpak
|
||||
if test -f $cache_file
|
||||
cat $cache_file
|
||||
set -l age (path mtime -R -- $cache_file)
|
||||
set -l max_age 250
|
||||
if test $age -lt $max_age
|
||||
return
|
||||
end
|
||||
end
|
||||
__fish_cache_put $cache_file
|
||||
__fish_flatpak remote-ls --columns=application,name >$cache_file &
|
||||
return 0
|
||||
end
|
||||
|
||||
complete -f -c flatpak -n "__fish_seen_subcommand_from run" -a "(__fish_flatpak list --app --columns=application,name)"
|
||||
complete -f -c flatpak -n "__fish_seen_subcommand_from info uninstall" -a "(__fish_flatpak list --columns=application,name)"
|
||||
complete -f -c flatpak -n "__fish_seen_subcommand_from enter kill" -a "(__fish_flatpak ps --columns=instance,application)"
|
||||
complete -f -c flatpak -n "__fish_seen_subcommand_from remote-info remote-ls remote-modify remote-delete" -a "(__fish_flatpak remotes --columns=name,title)"
|
||||
|
||||
complete -c flatpak -n '__fish_seen_subcommand_from install' -xa "(__fish_print_flatpak_packages)"
|
||||
complete -c flatpak -n '__fish_seen_subcommand_from install' -xa "(__fish_cached -t 250 -- '__fish_flatpak remote-ls --columns=application,name')"
|
||||
|
||||
# Plenty of the other stuff is too free-form to complete (e.g. remote-add).
|
||||
complete -f -c flatpak -s h -l help
|
||||
|
||||
@@ -16,8 +16,7 @@ function __fish_git
|
||||
end
|
||||
end
|
||||
# Using 'command git' to avoid interactions for aliases from git to (e.g.) hub
|
||||
set -l git $__fish_git_timeout git
|
||||
command $git $global_args $saved_args 2>/dev/null
|
||||
command git $global_args $saved_args 2>/dev/null
|
||||
end
|
||||
|
||||
# Print an optspec for argparse to handle git's options that are independent of any subcommand.
|
||||
@@ -67,7 +66,7 @@ function __fish_git_local_branches
|
||||
end
|
||||
|
||||
function __fish_git_remote_branches
|
||||
__fish_git_timeout=(string split ' ' -- (command -v timeout)' 0.200') __fish_git for-each-ref --format='%(refname:strip=2)%09Remote Branch' refs/remotes/ 2>/dev/null
|
||||
__fish_git for-each-ref --format='%(refname:strip=2)%09Remote Branch' refs/remotes/ 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_git_unique_remote_branches
|
||||
@@ -75,7 +74,7 @@ function __fish_git_unique_remote_branches
|
||||
# if they are unambiguous.
|
||||
# E.g. if only alice has a "frobulate" branch
|
||||
# `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`.
|
||||
__fish_git_timeout=(string split ' ' -- (command -v timeout)' 0.200') __fish_git for-each-ref --format="%(refname:strip=3)" \
|
||||
__fish_git for-each-ref --format="%(refname:strip=3)" \
|
||||
--sort="refname:strip=3" \
|
||||
refs/remotes/ 2>/dev/null | uniq -u
|
||||
end
|
||||
@@ -95,6 +94,12 @@ function __fish_git_heads
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_git_remote_heads
|
||||
# Example of output parsed:
|
||||
# "remote.upstream.url git@github.com:fish-shell/fish-shell.git" -> "upstream\tgit@github.com:fish-shell/fish-shell.git"
|
||||
__fish_git for-each-ref --format="%(refname:strip=2)" 'refs/remotes/*/HEAD' | path dirname
|
||||
end
|
||||
|
||||
function __fish_git_refs
|
||||
__fish_git_branches
|
||||
__fish_git_tags
|
||||
@@ -107,28 +112,20 @@ function __fish_git_remotes
|
||||
__fish_git config --get-regexp 'remote\.[a-z]+\.url' | string replace -rf 'remote\.(.*)\.url (.*)' '$1\t$2'
|
||||
end
|
||||
|
||||
set -g __fish_git_extra_recent_commits false
|
||||
set -g __fish_git_recent_commits_arg
|
||||
set -g __fish_git_unqualified_unique_remote_branches false
|
||||
set -g __fish_git_filter_non_pushable 'string join \n'
|
||||
set -g __fish_git_filter_non_pushable ''
|
||||
|
||||
function __fish_git_add_revision_completion
|
||||
set -l c complete -f -c git $argv -n 'not contains -- -- (commandline -xpc)' -ka
|
||||
# The following dynamic, order-preserved (-k) completions will be shown in reverse order (see #9221)
|
||||
$c "(__fish_git_recent_commits \$(
|
||||
if $__fish_git_extra_recent_commits
|
||||
begin
|
||||
echo HEAD
|
||||
git for-each-ref --sort=-committerdate --format='%(refname)' 2>/dev/null \
|
||||
refs/tags refs/heads
|
||||
end | string join ' '
|
||||
end
|
||||
) | $__fish_git_filter_non_pushable)"
|
||||
$c "(__fish_git_recent_commits $__fish_git_recent_commits_arg $__fish_git_filter_non_pushable)"
|
||||
$c "(__fish_git_tags)" -d Tag
|
||||
$c "(__fish_git_heads | $__fish_git_filter_non_pushable)" -d Head
|
||||
$c "(__fish_git_remotes | $__fish_git_filter_non_pushable)" -d 'Remote alias'
|
||||
$c "(__fish_git_remote_branches | $__fish_git_filter_non_pushable)"
|
||||
$c "(__fish_git_remote_heads $__fish_git_filter_non_pushable)" -d 'Remote alias'
|
||||
$c "(__fish_git_heads $__fish_git_filter_non_pushable)" -d Head
|
||||
$c "(__fish_git_remote_branches $__fish_git_filter_non_pushable)"
|
||||
if $__fish_git_unqualified_unique_remote_branches
|
||||
$c "(__fish_git_unique_remote_branches | $__fish_git_filter_non_pushable)" -d 'Unique Remote Branch'
|
||||
$c "(__fish_git_unique_remote_branches $__fish_git_filter_non_pushable)" -d 'Unique Remote Branch'
|
||||
end
|
||||
$c "(__fish_git_local_branches)" -d 'Local Branch'
|
||||
end
|
||||
@@ -807,7 +804,8 @@ function __fish_git_custom_commands
|
||||
# if any of these completion results match the name of the builtin git commands,
|
||||
# but it's simpler just to blacklist these names. They're unlikely to change,
|
||||
# and the failure mode is we accidentally complete a plumbing command.
|
||||
for name in (string replace -r "^.*/git-([^/]*)" '$1' $PATH/git-*)
|
||||
set -l git_subcommands $PATH/git-*
|
||||
for name in (string replace -r "^.*/git-([^/]*)" '$1' $git_subcommands)
|
||||
switch $name
|
||||
case cvsserver receive-pack shell upload-archive upload-pack
|
||||
# skip these
|
||||
@@ -1213,7 +1211,7 @@ complete -c git -n '__fish_git_using_command am' -l show-current-patch -a 'diff
|
||||
complete -F -c git -n '__fish_git_using_command checkout' -n 'contains -- -- (commandline -xpc)'
|
||||
complete -f -c git -n __fish_git_needs_command -a checkout -d 'Checkout and switch to a branch'
|
||||
begin
|
||||
set -lx __fish_git_extra_recent_commits true
|
||||
set -lx __fish_git_recent_commits_arg --all
|
||||
set -lx __fish_git_unqualified_unique_remote_branches true
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command checkout'
|
||||
end
|
||||
@@ -1386,6 +1384,35 @@ complete -f -c git -n '__fish_git_using_command clone' -s b -l branch -d 'Use a
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l depth -d 'Truncate the history to a specified number of revisions'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l recursive -d 'Initialize all submodules within the cloned repository'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l filter -ra '(__fish_git_filters)' -d 'Partial clone by requesting a subset of objects from server'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l single-branch -d 'Clone only the history leading to the tip of a single branch'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l no-single-branch -d 'Clone histories near the tips of all branches'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -s l -l local -d 'Bypass transport mechanism for local repositories'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l no-local -d 'Use Git transport for local paths'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -s s -l shared -d 'Setup .git/objects/info/alternates to share objects'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l dissociate -d 'Stop borrowing objects from reference repositories after clone'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l progress -d 'Force progress status'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l server-option -d 'Transmit string to the server when using protocol version 2'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l no-reject-shallow -d 'Do not fail if the source repository is a shallow repository'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l reject-shallow -d 'Fail if the source repository is a shallow repository'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l sparse -d 'Employ a sparse-checkout'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l also-filter-submodules -d 'Apply partial clone filter to submodules'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l revision -r -d 'Fetch history leading to the given revision'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -s u -l upload-pack -r -d 'Specify a non-default path for the command on the other end'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l template -r -d 'Specify the directory from which templates will be used'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -s c -l config -r -d 'Set a configuration variable in the new repository'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l shallow-since -r -d 'Create a shallow clone with a history after the specified time'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l shallow-exclude -r -d 'Create a shallow clone excluding commits from a specified ref'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l no-tags -d 'Do not clone tags'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l tags -d 'Clone tags'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l recurse-submodules -r -d 'Initialize and clone submodules'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l shallow-submodules -d 'Clone submodules with a depth of 1'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l no-shallow-submodules -d 'Do not clone submodules shallowly'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l remote-submodules -d 'Use submodule remote-tracking branch to update'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l no-remote-submodules -d 'Do not use submodule remote-tracking branch to update'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l separate-git-dir -r -d 'Place the cloned repository in a specified directory'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l ref-format -f -a "files reftable" -d 'Specify the ref storage format'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -s j -l jobs -r -d 'Number of submodules fetched at the same time'
|
||||
complete -f -c git -n '__fish_git_using_command clone' -l bundle-uri -r -d 'Fetch a bundle from the given URI'
|
||||
|
||||
### commit
|
||||
complete -c git -n __fish_git_needs_command -a commit -d 'Record changes to the repository'
|
||||
@@ -1475,7 +1502,7 @@ complete -c git -n __fish_git_needs_command -a diff -d 'Show changes between com
|
||||
complete -c git -n '__fish_git_using_command diff' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_ranges)'
|
||||
complete -c git -n '__fish_git_using_command diff' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_complete_stashes)'
|
||||
begin
|
||||
set -lx __fish_git_extra_recent_commits true
|
||||
set -lx __fish_git_recent_commits_arg --all
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command diff'
|
||||
end
|
||||
complete -c git -n '__fish_git_using_command diff' -l cached -d 'Show diff of changes in the index'
|
||||
@@ -1963,8 +1990,7 @@ complete -f -c git -n '__fish_git_using_command range-diff' -l no-dual-color -d
|
||||
complete -f -c git -n __fish_git_needs_command -a push -d 'Push changes elsewhere'
|
||||
complete -f -c git -n '__fish_git_using_command push' -n 'not __fish_git_branch_for_remote' -a '(__fish_git_remotes)' -d 'Remote alias'
|
||||
begin
|
||||
# TODO
|
||||
set -lx __fish_git_filter_non_pushable 'string replace -r "(\t.*)?\$" ":\$1"'
|
||||
set -lx __fish_git_filter_non_pushable '| string replace -r "(\t.*)?\$" ":\$1"'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command push' -n __fish_git_branch_for_remote
|
||||
end
|
||||
# The "refspec" here is an optional "+" to signify a force-push
|
||||
@@ -1997,8 +2023,9 @@ __fish_git_add_revision_completion -n '__fish_git_using_command rebase'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l continue -d 'Restart the rebasing process'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l abort -d 'Abort the rebase operation'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l edit-todo -d 'Edit the todo list'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l keep-empty -d "Keep the commits that don't change anything"
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -n __fish_git_is_rebasing -l skip -d 'Restart the rebasing process by skipping the current patch'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l keep-empty -d "Keep the commits that don't change anything"
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l keep-base -d 'Keep the base commit as-is'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -s m -l merge -d 'Use merging strategies to rebase'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -s q -l quiet -d 'Be quiet'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -s v -l verbose -d 'Be verbose'
|
||||
@@ -2070,7 +2097,7 @@ complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_branche
|
||||
complete -f -c git -n '__fish_git_using_command switch' -s c -l create -d 'Create a new branch'
|
||||
complete -f -c git -n '__fish_git_using_command switch' -s C -l force-create -d 'Force create a new branch'
|
||||
begin
|
||||
set -lx __fish_git_extra_recent_commits true
|
||||
set -lx __fish_git_recent_commits_arg --all
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command switch' -s d -l detach -r
|
||||
end
|
||||
complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -d 'Switch to a commit for inspection and discardable experiment' -rka '(__fish_git_refs)'
|
||||
@@ -2616,7 +2643,8 @@ end
|
||||
|
||||
# source git-* commands' autocompletion file if exists
|
||||
set -l __fish_git_custom_commands_completion
|
||||
for file in (path filter -xZ $PATH/git-* | path basename)
|
||||
set -l git_subcommands $PATH/git-*
|
||||
for file in (path filter -xZ $git_subcommands | path basename)
|
||||
# Already seen this command earlier in $PATH.
|
||||
contains -- $file $__fish_git_custom_commands_completion
|
||||
and continue
|
||||
@@ -2628,6 +2656,6 @@ for file in (path filter -xZ $PATH/git-* | path basename)
|
||||
end
|
||||
|
||||
functions --erase __fish_git_add_revision_completion
|
||||
set -eg __fish_git_extra_recent_commits
|
||||
set -eg __fish_git_recent_commits_arg
|
||||
set -eg __fish_git_unqualified_unique_remote_branches
|
||||
set -eg __fish_git_filter_non_pushable
|
||||
|
||||
@@ -4,5 +4,5 @@ complete -c gpasswd -s d -l delete -d 'Remove user from group' -xa '(__fish_comp
|
||||
complete -c gpasswd -s h -l help -d 'Print help'
|
||||
complete -c gpasswd -s r -l remove-password -d 'Remove the GROUP\'s password'
|
||||
complete -c gpasswd -s R -l restrict -d 'Restrict access to GROUP to its members'
|
||||
complete -c gpasswd -s M -l members -d 'Set the list of members of GROUP' -xa '(__fish_complete_list , __fish_complete_users)'
|
||||
complete -c gpasswd -s A -l administrators -d 'set the list of administrators for GROUP' -xa '(__fish_complete_list , __fish_complete_users)'
|
||||
complete -c gpasswd -s M -l members -d 'Set the list of members of GROUP' -xa "(__fish_stripprefix='^(--members=|-\w*M)' __fish_complete_list , __fish_complete_users)"
|
||||
complete -c gpasswd -s A -l administrators -d 'set the list of administrators for GROUP' -xa "(__fish_stripprefix='^(--administrators=|-\w*A)' __fish_complete_list , __fish_complete_users)"
|
||||
|
||||
@@ -36,7 +36,7 @@ complete -c $command -s x -x \
|
||||
-n $compile_condition
|
||||
|
||||
complete -c $command -s W -l warning \
|
||||
-a '(__fish_complete_list , __fish_guild__complete_warnings)' \
|
||||
-a "(__fish_stripprefix='^(--warning=|-\w*W)' __fish_complete_list , __fish_guild__complete_warnings)" \
|
||||
-d 'Specify the warning level for a compilation' \
|
||||
-n $compile_condition
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ complete -c $command -o ds \
|
||||
-d 'Treat the last -s option as if it occurred at this point'
|
||||
|
||||
complete -c $command -l use-srfi \
|
||||
-a '(__fish_complete_list , __fish_guile__complete_srfis)' \
|
||||
-a "(__fish_stripprefix='^--use-srfi=' __fish_complete_list , __fish_guile__complete_srfis)" \
|
||||
-d 'Specify the SRFI modules to load'
|
||||
|
||||
for standard in 6 7
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
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 -d Decompress -k -x -a "(__fish_complete_suffix .gz .tgz)"
|
||||
|
||||
complete -c gzip -s f -l force -d Overwrite
|
||||
complete -c gzip -s h -l help -d "Display help and exit"
|
||||
|
||||
@@ -58,7 +58,7 @@ complete -c hashcat -l restore -d "Restore session from --session"
|
||||
complete -c hashcat -l restore-disable -d "Do not write restore file"
|
||||
complete -c hashcat -l restore-file-path -rF -d "Specific path to restore file"
|
||||
complete -c hashcat -s o -l outfile -rF -d "Define outfile for recovered hash"
|
||||
complete -c hashcat -l outfile-format -xa "(__fish_complete_list , __fish_hashcat_outfile_formats)" -d "Outfile formats to use"
|
||||
complete -c hashcat -l outfile-format -xa "(__fish_stripprefix='^--outfile-format=' __fish_complete_list , __fish_hashcat_outfile_formats)" -d "Outfile formats to use"
|
||||
complete -c hashcat -l outfile-autohex-disable -d "Disable the use of \$HEX[] in output plains"
|
||||
complete -c hashcat -l outfile-check-timer -x -d "Sets seconds between outfile checks"
|
||||
complete -c hashcat -l wordlist-autohex-disable -d "Disable the conversion of \$HEX[] from the wordlist"
|
||||
@@ -106,7 +106,7 @@ complete -c hashcat -l backend-ignore-metal -d "Do not try to open Metal interfa
|
||||
complete -c hashcat -l backend-ignore-opencl -d "Do not try to open OpenCL interface on startup"
|
||||
complete -c hashcat -s I -l backend-info -d "Show info about detected backend API devices"
|
||||
complete -c hashcat -s d -l backend-devices -x -d "Backend devices to use"
|
||||
complete -c hashcat -s D -l opencl-device-types -xa "(__fish_complete_list , __fish_hashcat_device_types)" -d "OpenCL device-types to use"
|
||||
complete -c hashcat -s D -l opencl-device-types -xa "(__fish_stripprefix='^(--opencl-device-types=|-\w*D)' __fish_complete_list , __fish_hashcat_device_types)" -d "OpenCL device-types to use"
|
||||
complete -c hashcat -s O -l optimized-kernel-enable -d "Enable optimized kernels (limits password length)"
|
||||
complete -c hashcat -s M -l multiply-accel-disable -d "Disable multiply kernel-accel with processor count"
|
||||
complete -c hashcat -s w -l workload-profile -d "Enable a specific workload profile" -xa "
|
||||
|
||||
1
share/completions/hubble.fish
Normal file
1
share/completions/hubble.fish
Normal file
@@ -0,0 +1 @@
|
||||
hubble completion fish 2>/dev/null | source
|
||||
@@ -9,7 +9,7 @@ function __fish_john_formats --description "Print JohnTheRipper hash formats"
|
||||
end
|
||||
|
||||
complete -c john -l help -d "print usage summary"
|
||||
complete -c john -l single -fa "(__fish_complete_list , __fish_john_rules)" -d "single crack mode"
|
||||
complete -c john -l single -fa "(__fish_stripprefix='^--single=' __fish_complete_list , __fish_john_rules)" -d "single crack mode"
|
||||
complete -c john -l single-seed -rf -d "add static seed word(s) for all salts in single mode"
|
||||
complete -c john -l single-wordlist -rF -d "short wordlist with static seed words/morphemes"
|
||||
complete -c john -l single-user-seed -rF -d "wordlist with seeds per username"
|
||||
@@ -35,8 +35,8 @@ complete -c john -l prince-case-permute -d "permute case of first letter"
|
||||
complete -c john -l prince-mmap -d "memory-map infile"
|
||||
complete -c john -l prince-keyspace -d "just show total keyspace that would be produced"
|
||||
complete -c john -l encoding -l input-encoding -fa "$__fish_john_encodings" -d "input encoding"
|
||||
complete -c john -l rules -fa "(__fish_complete_list , __fish_john_rules)" -d "enable word mangling rules"
|
||||
complete -c john -l rules-stack -fa "(__fish_complete_list , __fish_john_rules)" -d "stacked rules"
|
||||
complete -c john -l rules -fa "(__fish_stripprefix='^--rules=' __fish_complete_list , __fish_john_rules)" -d "enable word mangling rules"
|
||||
complete -c john -l rules-stack -fa "(__fish_stripprefix='^--rules-stack=' __fish_complete_list , __fish_john_rules)" -d "stacked rules"
|
||||
complete -c john -l rules-skip-nop -d "skip any NOP rules"
|
||||
complete -c john -l incremental -fa "(john --list=inc-modes 2>/dev/null)" -d "incremental mode"
|
||||
complete -c john -l incremental-charcount -rf -d "override CharCount for incremental mode"
|
||||
@@ -97,4 +97,4 @@ complete -c john -l internal-codepage -fa "$__fish_john_encodings" -d "codepage
|
||||
complete -c john -l target-encoding -fa "$__fish_john_encodings" -d "output encoding"
|
||||
complete -c john -l tune -fa "auto report N" -d "tuning options"
|
||||
complete -c john -l force-tty -d "set up terminal for reading keystrokes"
|
||||
complete -c john -l format -fa "(__fish_complete_list , __fish_john_formats)" -d "force hash type"
|
||||
complete -c john -l format -fa "(__fish_stripprefix='^--format=' __fish_complete_list , __fish_john_formats)" -d "force hash type"
|
||||
|
||||
@@ -30,6 +30,7 @@ complete -c journalctl -f -l version -d 'Prints a short version string and exits
|
||||
complete -c journalctl -f -l no-pager -d 'Do not pipe output into a pager'
|
||||
complete -c journalctl -f -s a -l all -d 'Show all fields in full'
|
||||
complete -c journalctl -f -s f -l follow -d 'Show live tail of entries'
|
||||
complete -c journalctl -f -s e -l pager-end -d 'Skip to the end of the journal'
|
||||
complete -c journalctl -f -s n -l lines -d 'Controls the number of journal lines'
|
||||
complete -c journalctl -f -l no-tail -d 'Show all lines, even in follow mode'
|
||||
complete -c journalctl -f -s o -l output -d 'Controls the formatting' -xa '(printf %s\t\n (command journalctl --output=help))'
|
||||
|
||||
1
share/completions/k9s.fish
Normal file
1
share/completions/k9s.fish
Normal file
@@ -0,0 +1 @@
|
||||
k9s completion fish 2>/dev/null | source
|
||||
@@ -1,24 +1,19 @@
|
||||
# Light is a program to control backlight controllers under GNU/Linux.
|
||||
# See: https://github.com/haikarainen/light
|
||||
|
||||
function __fish_print_light_controllers
|
||||
command light -L
|
||||
end
|
||||
|
||||
complete -c light -s h -d 'Print help and exit'
|
||||
complete -c light -s h -s -H -d 'Print help and exit'
|
||||
complete -c light -s V -d 'Print version info and exit'
|
||||
complete -c light -s G -d 'Get value (default)'
|
||||
complete -c light -s S -x -d 'Set value'
|
||||
complete -c light -s L -d 'List controllers'
|
||||
complete -c light -s A -x -d 'Add value'
|
||||
complete -c light -s U -x -d 'Subtract value'
|
||||
complete -c light -s L -d 'List controllers'
|
||||
complete -c light -s I -d 'Restore brightness'
|
||||
complete -c light -s T -d 'Save brightness'
|
||||
complete -c light -s S -x -d 'Set value'
|
||||
complete -c light -s G -d 'Get value (default)'
|
||||
complete -c light -s N -d 'Set minimum brightness'
|
||||
complete -c light -s P -d 'Get minimum brightness'
|
||||
complete -c light -s O -d 'Save brightness'
|
||||
complete -c light -s b -d 'Brightness (default)'
|
||||
complete -c light -s m -d 'Maximum brightness'
|
||||
complete -c light -s c -d 'Minimum cap'
|
||||
complete -c light -s a -d 'Selects controller automatically (default)'
|
||||
complete -c light -s s -a '(__fish_print_light_controllers)' -x -d 'Specify controller to use'
|
||||
complete -c light -s p -d 'Interpret & output values in percent'
|
||||
complete -c light -s I -d 'Restore brightness after saving'
|
||||
|
||||
complete -c light -s r -d 'Interpret & output values in raw mode'
|
||||
complete -c light -s s -a '(command light -L)' -x -d 'Specify controller to use'
|
||||
complete -c light -s v -x -d 'Sets the verbosity level' -a '0\tRead\ values 1\tRead\ values\ \&\ errors 2\tRead\ values,\ errors\ \&\ warnings 3\tRead\ values,\ errors,\ warnings\ \&\ notices'
|
||||
|
||||
@@ -41,7 +41,7 @@ complete -c losetup -s v -l verbose -d "Verbose mode"
|
||||
complete -c losetup -s J -l json -d "Use JSON --list output format"
|
||||
complete -c losetup -s l -l list -d "List info about all or specified"
|
||||
complete -c losetup -s n -l noheadings -d "Don't print headings for --list output"
|
||||
complete -c losetup -s O -l output -x -a "(__fish_complete_list , __fish_print_losetup_list_output)" -d "Specify columns to output for --list"
|
||||
complete -c losetup -s O -l output -x -a "(__fish_stripprefix='^(--output=|-\w*O)' __fish_complete_list , __fish_print_losetup_list_output)" -d "Specify columns to output for --list"
|
||||
complete -c losetup -l output-all -d "Output all columns"
|
||||
complete -c losetup -l raw -d "Use raw --list output format"
|
||||
complete -c losetup -s h -l help -d "Display help"
|
||||
|
||||
@@ -25,7 +25,7 @@ complete -c lpadmin -s o -xa printer-is-shared=true -d 'Sets dest to shared/publ
|
||||
complete -c lpadmin -s o -xa printer-is-shared=false -d 'Sets dest to shared/published or unshared/unpublished'
|
||||
complete -c lpadmin -s o -d 'Set IPP operation policy associated with dest' -xa "printer-policy=(test -r /etc/cups/cupsd.conf; and string replace -r --filter '<Policy (.*)>' '$1' < /etc/cups/cupsd.conf)"
|
||||
|
||||
complete -c lpadmin -s u -xa 'allow:all allow:none (__fish_complete_list , __fish_complete_users allow:)' -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa '(__fish_complete_list , __fish_complete_groups allow: @)' -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa 'deny:all deny:none (__fish_complete_list , __fish_complete_users deny:)' -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa '(__fish_complete_list , __fish_complete_groups deny: @)' -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa "allow:all allow:none (__fish_stripprefix='^-\w*u' __fish_complete_list , __fish_complete_users allow:)" -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa "(__fish_stripprefix='^-\w*u' __fish_complete_list , __fish_complete_groups allow: @)" -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa "deny:all deny:none (__fish_stripprefix='^-\w*u' __fish_complete_list , __fish_complete_users deny:)" -d 'Sets user-level access control on a destination'
|
||||
complete -c lpadmin -s u -xa "(__fish_stripprefix='^-\w*u' __fish_complete_list , __fish_complete_groups deny: @)" -d 'Sets user-level access control on a destination'
|
||||
|
||||
@@ -12,7 +12,7 @@ complete -c lsblk -s h -l help -d "usage information (this)"
|
||||
complete -c lsblk -s i -l ascii -d "use ascii characters only"
|
||||
complete -c lsblk -s m -l perms -d "output info about permissions"
|
||||
complete -c lsblk -s n -l noheadings -d "don't print headings"
|
||||
complete -c lsblk -s o -l output -d "output columns" -xa '( __fish_complete_list , __fish_print_lsblk_columns )'
|
||||
complete -c lsblk -s o -l output -d "output columns" -xa "(__fish_stripprefix='^(--output=|-\w*o)' __fish_complete_list , __fish_print_lsblk_columns)"
|
||||
complete -c lsblk -s P -l pairs -d "use key='value' output format"
|
||||
complete -c lsblk -s r -l raw -d "use raw output format"
|
||||
complete -c lsblk -s t -l topology -d "output info about topology"
|
||||
|
||||
@@ -11,9 +11,9 @@ i\t"ignore the device cache file"
|
||||
r\t"read the device cache file"
|
||||
u\t"read and update the device cache file"'
|
||||
|
||||
complete -c lsof -s g -d 'select by group (^ - negates)' -xa '(__fish_complete_list , __fish_complete_groups)'
|
||||
complete -c lsof -s g -d 'select by group (^ - negates)' -xa "(__fish_stripprefix='^-\w*g' __fish_complete_list , __fish_complete_groups)"
|
||||
complete -c lsof -s l -d 'Convert UIDs to login names'
|
||||
complete -c lsof -s p -d 'Select or exclude processes by pid' -xa '(__fish_complete_list , __fish_complete_pids)'
|
||||
complete -c lsof -s p -d 'Select or exclude processes by pid' -xa "(__fish_stripprefix='^-\w*p' __fish_complete_list , __fish_complete_pids)"
|
||||
complete -c lsof -s R -d 'Print PPID'
|
||||
complete -c lsof -s t -d 'Produce terse output (pids only, no header)'
|
||||
complete -c lsof -s u -d 'select by user (^ - negates)' -xa '(__fish_complete_list , __fish_complete_users)'
|
||||
complete -c lsof -s u -d 'select by user (^ - negates)' -xa "(__fish_stripprefix='^-\w*u' __fish_complete_list , __fish_complete_users)"
|
||||
|
||||
@@ -35,7 +35,7 @@ function __fish_complete_openssl_ciphers
|
||||
printf "%s\tCipher String\n" $cs
|
||||
end
|
||||
end
|
||||
complete -c ncat -l ssl-ciphers -x -a "(__fish_complete_list : __fish_complete_openssl_ciphers)" -d "Specify SSL ciphersuites"
|
||||
complete -c ncat -l ssl-ciphers -x -a "(__fish_stripprefix='^--ssl-ciphers=' __fish_complete_list : __fish_complete_openssl_ciphers)" -d "Specify SSL ciphersuites"
|
||||
complete -c ncat -l ssl-servername -x -a "(__fish_print_hostnames)" -d "Request distinct server name"
|
||||
complete -c ncat -l ssl-alpn -x -d "Specify ALPN protocol list"
|
||||
|
||||
|
||||
@@ -92,11 +92,11 @@ function __fish_complete_nmap_script
|
||||
end
|
||||
echo -e $__fish_nmap_script_completion_cache
|
||||
end
|
||||
complete -c nmap -l script -r -a "(__fish_complete_list , __fish_complete_nmap_script)"
|
||||
complete -c nmap -l script -r -a "(__fish_stripprefix='^--script=' __fish_complete_list , __fish_complete_nmap_script)"
|
||||
complete -c nmap -l script -r -d 'Runs a script scan'
|
||||
complete -c nmap -l script-args -d 'provide arguments to NSE scripts'
|
||||
complete -c nmap -l script-args-file -r -d 'load arguments to NSE scripts from a file'
|
||||
complete -c nmap -l script-help -r -a "(__fish_complete_list , __fish_complete_nmap_script)"
|
||||
complete -c nmap -l script-help -r -a "(__fish_stripprefix='^--script-help=' __fish_complete_list , __fish_complete_nmap_script)"
|
||||
complete -c nmap -l script-help -r -d "Shows help about scripts"
|
||||
complete -c nmap -l script-trace
|
||||
complete -c nmap -l script-updatedb
|
||||
|
||||
@@ -24,6 +24,7 @@ complete -c objdump -l target -s b -d "Specify target object format" -x -a "elf6
|
||||
complete -c objdump -l architecture -s m -d "Specify target architecture" -x -a "i386 i386:x86-64 i386:x64-32 i8086 i386:intel i386:x86-64:intel i386:x64-32:intel i386:nacl i386:x86-64:nacl i386:x64-32:nacl iamcu iamcu:intel l1om l1om:intel k1om k1om:intel plugin"
|
||||
complete -c objdump -l section -s j -d "Only display information for given section" -x
|
||||
complete -c objdump -l disassembler-options -s M -d "Pass given options on to disassembler" -x
|
||||
complete -c objdump -l disassembler-color -d "Control disassembler syntax highlighting style" -x -a "off terminal on extended"
|
||||
complete -c objdump -l endian -x -d "Set format endianness when disassembling" -a "big little"
|
||||
complete -c objdump -o EB -d "Assume big endian format when disassembling"
|
||||
complete -c objdump -o EL -d "Assume little endian format when disassembling"
|
||||
|
||||
@@ -2,11 +2,16 @@ function __fish_ollama_list
|
||||
ollama list 2>/dev/null | tail -n +2 | string replace --regex "\s.*" ""
|
||||
end
|
||||
|
||||
function __fish_ollama_ps
|
||||
ollama ps 2>/dev/null | tail -n +2 | string replace --regex "\s.*" ""
|
||||
end
|
||||
|
||||
complete -f -c ollama
|
||||
complete -c ollama -n __fish_use_subcommand -a serve -d "Start ollama"
|
||||
complete -c ollama -n __fish_use_subcommand -a create -d "Create a model from a Modelfile"
|
||||
complete -c ollama -n __fish_use_subcommand -a show -d "Show information for a model"
|
||||
complete -c ollama -n __fish_use_subcommand -a run -d "Run a model"
|
||||
complete -c ollama -n __fish_use_subcommand -a stop -d "Stop a running model."
|
||||
complete -c ollama -n __fish_use_subcommand -a pull -d "Pull a model from a registry"
|
||||
complete -c ollama -n __fish_use_subcommand -a push -d "Push a model to a registry"
|
||||
complete -c ollama -n __fish_use_subcommand -a list -d "List models"
|
||||
@@ -19,3 +24,4 @@ complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcomm
|
||||
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from run'
|
||||
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from cp'
|
||||
complete -c ollama -f -a "(__fish_ollama_list)" --condition '__fish_seen_subcommand_from rm'
|
||||
complete -c ollama -f -a "(__fish_ollama_ps)" --condition '__fish_seen_subcommand_from stop'
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# TODO: POSIX patch
|
||||
#
|
||||
|
||||
|
||||
# No effect on POSIX systems that don't use O_BINARY/O_TEXT
|
||||
uname -s | string match -q CYGWIN\*
|
||||
and complete -c patch -l binary -d "Read & write data in binary mode"
|
||||
|
||||
9
share/completions/protontricks-launch.fish
Normal file
9
share/completions/protontricks-launch.fish
Normal file
@@ -0,0 +1,9 @@
|
||||
complete -c protontricks-launch -f -s h -l help -d 'Show help message and exit'
|
||||
complete -c protontricks-launch -l no-term -d 'Specify no terminal is available for errors, use dialogs instead'
|
||||
complete -c protontricks-launch -s v -l verbose -d 'Increase log verbosity, can be supplied twice'
|
||||
complete -c protontricks-launch -l no-runtime -d 'Disable Steam Runtime'
|
||||
complete -c protontricks-launch -l no-bwrap -d 'Disable bwrap containerization when using Steam Runtime'
|
||||
complete -c protontricks-launch -l background-wineserver -d 'Launch a wineserver process to improve Wine startup time'
|
||||
complete -c protontricks-launch -l no-background-wineserver -d 'Do not launch wineserver process'
|
||||
complete -c protontricks-launch -l appid -xka '(__fish_protontricks_complete_appid)'
|
||||
complete -c protontricks-launch -l cwd-app -d 'Change to the Steam app directory when launching command'
|
||||
24
share/completions/protontricks.fish
Normal file
24
share/completions/protontricks.fish
Normal file
@@ -0,0 +1,24 @@
|
||||
function __fish_protontricks_complete_winetricks_command
|
||||
complete -C 'winetricks '
|
||||
end
|
||||
|
||||
function __fish_protontricks_is_search
|
||||
__fish_contains_opt -s s search
|
||||
end
|
||||
|
||||
complete -c protontricks -f
|
||||
complete -c protontricks -n 'not __fish_protontricks_is_search' -n '__fish_is_nth_token 1' -ka '(__fish_protontricks_complete_appid)'
|
||||
complete -c protontricks -n 'not __fish_protontricks_is_search' -n 'not __fish_is_nth_token 1' -a '(__fish_protontricks_complete_winetricks_command)'
|
||||
complete -c protontricks -s h -l help -d 'Show help message and exit'
|
||||
complete -c protontricks -s v -l verbose -d 'Increase log verbosity, can be supplied twice'
|
||||
complete -c protontricks -l no-term -d 'Specify that no terminal is available to Protontricks'
|
||||
complete -c protontricks -s s -l search -d 'Search for game(s) with the given name'
|
||||
complete -c protontricks -s l -l list -d 'List all apps'
|
||||
complete -c protontricks -s c -l command -xa '(__fish_complete_subcommand)' -d 'Run a command with Wine-related environment variables set'
|
||||
complete -c protontricks -l gui -d 'Launch the Protontricks GUI'
|
||||
complete -c protontricks -l no-runtime -d 'Disable Steam Runtime'
|
||||
complete -c protontricks -l no-bwrap -d 'Disable bwrap containerization when using Steam Runtime'
|
||||
complete -c protontricks -l background-wineserver -d 'Launch a wineserver process to improve Wine startup time'
|
||||
complete -c protontricks -l no-background-wineserver -d 'Do not launch wineserver process'
|
||||
complete -c protontricks -l cwd-app -d 'Change to the Steam app directory when launching command'
|
||||
complete -c protontricks -s V -l version -d 'Show version number and exit'
|
||||
@@ -10,7 +10,7 @@ if test "$gnu_linux" -eq 1
|
||||
# Some short options are GNU-only
|
||||
complete -c ps -s a -d "Select all processes except session leaders and terminal-less"
|
||||
complete -c ps -s A -d "Select all"
|
||||
complete -c ps -s C -d "Select by command" -ra '(__fish_complete_list , __fish_complete_proc)'
|
||||
complete -c ps -s C -d "Select by command" -ra "(__fish_stripprefix='^-\w*C' __fish_complete_list , __fish_complete_proc)"
|
||||
complete -c ps -s c -d 'Show different scheduler information for the -l option'
|
||||
complete -c ps -s d -d "Select all processes except session leaders"
|
||||
complete -c ps -s e -d "Select all"
|
||||
@@ -24,9 +24,9 @@ if test "$gnu_linux" -eq 1
|
||||
complete -c ps -s m -d 'Show threads after processes'
|
||||
complete -c ps -s N -d "Invert selection"
|
||||
complete -c ps -s n -d "Set namelist file" -r
|
||||
complete -c ps -s s -l sid -d "Select by session ID" -x -a "(__fish_complete_list , __fish_complete_pids)"
|
||||
complete -c ps -s s -l sid -d "Select by session ID" -x -a "(__fish_stripprefix='^(--sid=|-\w*s)' __fish_complete_list , __fish_complete_pids)"
|
||||
complete -c ps -s T -d "Show threads. With SPID"
|
||||
complete -c ps -s u -l user -d "Select by user" -x -a "(__fish_complete_list , __fish_complete_users)"
|
||||
complete -c ps -s u -l user -d "Select by user" -x -a "(__fish_stripprefix='^(--script=|-\w*u)' __fish_complete_list , __fish_complete_users)"
|
||||
complete -c ps -s V -l version -d "Display version and exit"
|
||||
complete -c ps -s y -d "Do not show flags"
|
||||
|
||||
@@ -39,7 +39,7 @@ if test "$gnu_linux" -eq 1
|
||||
complete -c ps -l info -d "Display debug info"
|
||||
complete -c ps -l lines -l rows -d "Set screen height" -r
|
||||
complete -c ps -l no-headers -d 'Print no headers'
|
||||
complete -c ps -l ppid -d "Select by parent PID" -x -a "(__fish_complete_list , __fish_complete_pids)"
|
||||
complete -c ps -l ppid -d "Select by parent PID" -x -a "(__fish_stripprefix='^--ppid=' __fish_complete_list , __fish_complete_pids)"
|
||||
complete -c ps -l sort -d 'Specify sort order' -r
|
||||
else
|
||||
# Assume BSD options otherwise
|
||||
@@ -81,6 +81,6 @@ end
|
||||
complete -c ps -s o -lformat$bsd_null -d "User defined format" -x
|
||||
complete -c ps -s Z -lcontext$bsd_null -d "Include security info"
|
||||
complete -c ps -s t -ltty$bsd_null -d "Select by tty" -r
|
||||
complete -c ps -s G -lgroup$bsd_null -d "Select by group" -x -a "(__fish_complete_list , __fish_complete_groups)"
|
||||
complete -c ps -s U -luser$bsd_null -d "Select by user" -x -a "(__fish_complete_list , __fish_complete_users)"
|
||||
complete -c ps -s p -lpid$bsd_null -d "Select by PID" -x -a "(__fish_complete_list , __fish_complete_pids)"
|
||||
complete -c ps -s G -lgroup$bsd_null -d "Select by group" -x -a "(__fish_stripprefix='^(--group=|-\w*G)' __fish_complete_list , __fish_complete_groups)"
|
||||
complete -c ps -s U -luser$bsd_null -d "Select by user" -x -a "(__fish_stripprefix='^(--user=|-\w*U)' __fish_complete_list , __fish_complete_users)"
|
||||
complete -c ps -s p -lpid$bsd_null -d "Select by PID" -x -a "(__fish_stripprefix='^(--pid=|-\w*p)' __fish_complete_list , __fish_complete_pids)"
|
||||
|
||||
@@ -15,7 +15,7 @@ complete -c setxkbmap -o keycodes -d 'Specifies keycodes component name' -xa "(s
|
||||
complete -c setxkbmap -o keymap -d 'Specifies name of keymap to load' -xa "(sed -r $filter /usr/share/X11/xkb/keymap.dir)"
|
||||
complete -c setxkbmap -o layout -d 'Specifies layout used to choose component names' -xa "(__fish_complete_setxkbmap layout)"
|
||||
complete -c setxkbmap -o model -d 'Specifies model used to choose component names' -xa "(__fish_complete_setxkbmap model)"
|
||||
complete -c setxkbmap -o option -d 'Adds an option used to choose component names' -xa "(__fish_complete_list , '__fish_complete_setxkbmap option')"
|
||||
complete -c setxkbmap -o option -d 'Adds an option used to choose component names' -xa "(__fish_stripprefix='^--option=' __fish_complete_list , '__fish_complete_setxkbmap option')"
|
||||
complete -c setxkbmap -o print -d 'Print a complete xkb_keymap description and exit'
|
||||
complete -c setxkbmap -o query -d 'Print the current layout settings and exit'
|
||||
complete -c setxkbmap -o rules -d 'Name of rules file to use' -x
|
||||
|
||||
@@ -25,7 +25,7 @@ complete -c ssh -s k -d "Disables forwarding of GSSAPI credentials"
|
||||
complete -c ssh -s L -d "Specify local port forwarding" -x
|
||||
complete -c ssh -s l -x -a "(__fish_complete_users)" -d User
|
||||
complete -c ssh -s M -d "Places the ssh client into master mode"
|
||||
complete -c ssh -s m -d "MAC algorithm" -xa "(__fish_complete_list , __fish_ssh_macs)"
|
||||
complete -c ssh -s m -d "MAC algorithm" -xa "(__fish_stripprefix='^-\w*m' __fish_complete_list , __fish_ssh_macs)"
|
||||
complete -c ssh -s N -d "Do not execute remote command"
|
||||
complete -c ssh -s n -d "Prevent reading from stdin"
|
||||
complete -c ssh -s O -d "Control an active connection multiplexing master process" -x
|
||||
|
||||
@@ -12,6 +12,6 @@ complete -c su -s G -l supp-group -x -a "(__fish_complete_groups)" -d "Specify a
|
||||
complete -c su -s m -s p -l preserve_environment -d "Preserve environment"
|
||||
complete -c su -s P -l pty -d "Create pseudo-terminal for the session"
|
||||
complete -c su -s s -l shell -x -a "(cat /etc/shells)" -d "Run the specified shell"
|
||||
complete -c su -s w -l whitelist-environment -x -a "(__fish_complete_list , __fish_complete_su_env_whitelist)" -d "Don't reset these environment variables"
|
||||
complete -c su -s w -l whitelist-environment -x -a "(__fish_stripprefix='^(--whitelist-environment=|-\w*w)' __fish_complete_list , __fish_complete_su_env_whitelist)" -d "Don't reset these environment variables"
|
||||
complete -c su -s h -l help -d "Display help and exit"
|
||||
complete -c su -s V -l version -d "Display version and exit"
|
||||
|
||||
@@ -3,8 +3,8 @@ set -l commands list-units list-sockets start stop reload restart try-restart re
|
||||
isolate kill is-active is-failed status show get-cgroup-attr set-cgroup-attr unset-cgroup-attr set-cgroup help \
|
||||
reset-failed list-unit-files enable disable is-enabled reenable preset mask unmask link load list-jobs cancel dump \
|
||||
list-dependencies snapshot delete daemon-reload daemon-reexec show-environment set-environment unset-environment \
|
||||
default rescue emergency halt poweroff reboot kexec exit suspend hibernate hybrid-sleep switch-root list-timers \
|
||||
set-property import-environment get-default list-automounts is-system-running try-reload-or-restart freeze \
|
||||
default rescue emergency halt poweroff reboot kexec exit suspend suspend-then-hibernate hibernate hybrid-sleep switch-root \
|
||||
list-timers set-property import-environment get-default list-automounts is-system-running try-reload-or-restart freeze \
|
||||
thaw mount-image bind clean
|
||||
if test $systemd_version -gt 208 2>/dev/null
|
||||
set commands $commands cat
|
||||
|
||||
@@ -40,6 +40,6 @@ complete -c systemd-cryptenroll -l fido2-with-user-presence -xa "yes no" -d "Req
|
||||
complete -c systemd-cryptenroll -l fido2-with-user-verification -xa "yes no" -d "Require user verification when unlocking the volume"
|
||||
complete -c systemd-cryptenroll -l tpm2-device -kxa "(__fish_cryptenroll_tpm2_devices)" -d "Enroll a TPM2 security chip"
|
||||
complete -c systemd-cryptenroll -l tpm2-pcrs -x -d "Bind the enrollment of TPM2 device to specified PCRs"
|
||||
complete -c systemd-cryptenroll -l wipe-slot -kxa "(__fish_complete_list , __fish_cryptenroll_complete_wipe)" -d "Wipes one or more LUKS2 key slots"
|
||||
complete -c systemd-cryptenroll -l wipe-slot -kxa "(__fish_stripprefix='^--wipe-slot=' __fish_complete_list , __fish_cryptenroll_complete_wipe)" -d "Wipes one or more LUKS2 key slots"
|
||||
complete -c systemd-cryptenroll -l help -s h -d "Print a short help"
|
||||
complete -c systemd-cryptenroll -l version -d "Print a short version string"
|
||||
|
||||
31
share/completions/t-rec.fish
Normal file
31
share/completions/t-rec.fish
Normal file
@@ -0,0 +1,31 @@
|
||||
# fish completion for t-rec (https://github.com/sassman/t-rec-rs
|
||||
|
||||
function __fish_t_rec_time_unit
|
||||
set -l cur (commandline --current-token)
|
||||
if string match -qr '^\d+$' -- $cur
|
||||
echo $cur"ms"\t"milliseconds"
|
||||
echo $cur"s"\t"seconds"
|
||||
echo $cur"m"\t"minutes"
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_t_rec_window_list
|
||||
string replace -r -- '\s*(.*)\|\s+(\d+)' '$2\t$1' (t-rec --ls | tail -n +2)
|
||||
end
|
||||
|
||||
# Options
|
||||
complete -c t-rec -d "Command to run instead of shell" -xa "(complete -C '' | string split \t -f1)"
|
||||
complete -c t-rec -s v -l verbose -d "Enable verbose insights for the curious"
|
||||
complete -c t-rec -s q -l quiet -d "Quiet mode, suppresses the banner"
|
||||
complete -c t-rec -s m -l video -d "Generate both gif and mp4 video"
|
||||
complete -c t-rec -s M -l video-only -d "Generate only mp4 video, not gif"
|
||||
complete -c t-rec -s d -l decor -d "Decorate animation" -xa "shadow none"
|
||||
complete -c t-rec -s b -l bg -d "Background color when decors are used" -xa "white black transparent"
|
||||
complete -c t-rec -s n -l natural -d "Natural typing, disables idle detection and sampling optimization"
|
||||
complete -c t-rec -s l -l ls -d "List windows available for recording by their id"
|
||||
complete -c t-rec -s w -l win-id -d "Id of window to capture" -xa "(__t_rec_window_list)"
|
||||
complete -c t-rec -s e -l end-pause -d "Pause time at end of animation" -xa "(__fish_t_rec_time_unit)" -r
|
||||
complete -c t-rec -s s -l start-pause -d "Pause time at start of animation" -xa "(__fish_t_rec_time_unit)" -r
|
||||
complete -c t-rec -s o -l output -d "Output file (without extension); defaults to t-rec" -r
|
||||
complete -c t-rec -s h -l help -d "Print help"
|
||||
complete -c t-rec -s V -l version -d "Print version"
|
||||
52
share/completions/tmuxp.fish
Normal file
52
share/completions/tmuxp.fish
Normal file
@@ -0,0 +1,52 @@
|
||||
function __fish_tmuxp_ls
|
||||
tmuxp ls 2>/dev/null
|
||||
end
|
||||
|
||||
complete -c tmuxp -f
|
||||
complete -c tmuxp -s h -l help -d Help
|
||||
complete -c tmuxp -s V -l version -d Version
|
||||
complete -c tmuxp -l log-level -x -a "debug info warning error critical" -d "Log level"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a load -d "Load tmuxp workspace"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a shell -d "Launch python shell"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a import -d "Import workspace"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a convert -d "Convert workspace"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a debug-info -d "Print diagnostics"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a ls -d "List workspaces"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a edit -d "Edit workspace"
|
||||
complete -c tmuxp -n __fish_use_subcommand -a freeze -d "Freeze session to worskpace"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -a "(__fish_tmuxp_ls)"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s L -r -F -d "Passthru to tmux -L"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s S -r -F -d "Passthru to tmux -S"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s f -r -F -d "Passthru to tmux -f"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s s -r -d "Session name"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s d -d "Detached session"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s a -r -d "Attach current windows to session"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s y -l yes -d "Always answer yes"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s 2 -d "Assume 256 color support"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -s 8 -d "Assume 88 color support"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from load" -l log-file -r -F -d "Log file path"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from import" -a "teamocil tmuxinator"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from convert" -s y -l yes -d "Always answer yes"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from convert" -r -F
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from edit" -a "(__fish_tmuxp_ls)"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -s L -r -F -d "Passthru to tmux -L"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -s S -r -F -d "Passthru to tmux -S"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -s f -l worskpace-format -x -a "json yaml" -d "File format"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -s o -l save-to -r -F -d "Output file"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -s y -l yes -d "Always answer yes"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -s q -l quiet -d "Do not prompt for confirmation"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from freeze" -l force -d "Overwrite existing file"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -s L -r -F -d "Passthru to tmux -L"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -s S -r -F -d "Passthru to tmux -S"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -s c -r -d "Run code and exit"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l best -d "Use best shell available"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l pdb -d "Use pdb"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l code -d "Use code.interact()"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l ptipython -d "Use ptpython+ipython"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l ptpython -d "Use ptpython"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l ipython -d "Use ipython"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l bpython -d "Use bpython"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l use-pythonrc -d "Load ~/.pythonrc.py"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l no-startup -d "Do not load ~/.pythonrc.py"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l use-vi-mode -d "Use vi input mode"
|
||||
complete -c tmuxp -n "__fish_seen_subcommand_from shell" -l no-vi-mode -d "Do not use vi input mode"
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
# Returns 0 if the command has not had a subcommand yet
|
||||
# Does not currently account for -chdir
|
||||
function __fish_tofu_needs_command
|
||||
|
||||
@@ -5,7 +5,7 @@ complete -c usermod -s d -l home -d "Change user's login directory" -r
|
||||
complete -c usermod -s e -l expiredate -d "Date (YYYY-MM-DD) on which the user account will be disabled" -x
|
||||
complete -c usermod -s f -l inactive -d "Number of days after a password expires until the account is locked" -xa "(seq 0 365)"
|
||||
complete -c usermod -s g -l gid -d "Group name or number of the user's new initial login group" -xa "(__fish_complete_groups)"
|
||||
complete -c usermod -s G -l groups -d "List of groups which the user is also a member of" -xa "(__fish_complete_list , __fish_complete_groups)"
|
||||
complete -c usermod -s G -l groups -d "List of groups which the user is also a member of" -xa "(__fish_stripprefix='^(--groups=|-\w*G)' __fish_complete_list , __fish_complete_groups)"
|
||||
complete -c usermod -s l -l login -d "Change user's name" -x
|
||||
complete -c usermod -s L -l lock -d "Lock user's password" -f
|
||||
complete -c usermod -s m -l move-home -d "Move the content of the user's home directory to the new location" -f
|
||||
|
||||
1
share/completions/volta.fish
Normal file
1
share/completions/volta.fish
Normal file
@@ -0,0 +1 @@
|
||||
volta completions fish 2>/dev/null | source
|
||||
@@ -1,5 +1,5 @@
|
||||
function __fish_winetricks__complete_verbs
|
||||
winetricks list-all 2>/dev/null |
|
||||
__fish_cached -t 3600 -- 'winetricks list-all 2>/dev/null' |
|
||||
string match --invert --regex '^==' |
|
||||
string match --invert --regex '^(apps|dlls|fonts|games|settings)$' |
|
||||
string replace --regex '(\S+)\s+(.+)' '$1\t$2'
|
||||
|
||||
@@ -50,7 +50,7 @@ complete -c $progname -s d -d 'Enable extra debugging shown to stderr'
|
||||
complete -c $progname -s h -d 'Show the help message'
|
||||
complete -c $progname -s i -d 'Ignore repositories defined in configuration files'
|
||||
complete -c $progname -s M -d 'For remote repositories, the data is fetched and stored in memory only'
|
||||
complete -c $progname -s p -d 'Match one or more package properties' -xa "(__fish_complete_list , __fish_print_xbps_pkg_props)"
|
||||
complete -c $progname -s p -d 'Match one or more package properties' -xa "(__fish_stripprefix='^-\w*p' __fish_complete_list , __fish_print_xbps_pkg_props)"
|
||||
complete -c $progname -s R -d 'Enable repository mode'
|
||||
complete -c $progname -l repository -d 'Append the specified repository to the top of the list'
|
||||
complete -c $progname -l regex -d 'Use Extended Regular Expressions'
|
||||
|
||||
44
share/functions/__fish_cached.fish
Normal file
44
share/functions/__fish_cached.fish
Normal file
@@ -0,0 +1,44 @@
|
||||
function __fish_cached --description "Cache the command output for a given amount of time"
|
||||
|
||||
argparse --min-args 1 --max-args 1 --stop-nonopt 't/max-age=!_validate_int --min 0' 'k/cache-key=' -- $argv
|
||||
or return
|
||||
|
||||
if set -q _flag_cache_key
|
||||
set -f cache_key $_flag_cache_key
|
||||
else
|
||||
set -f cache_key (string trim "$argv" | string split ' ')[1]
|
||||
end
|
||||
if not string match -q --regex '^[\w+-]+$' -- "$cache_key"
|
||||
return 1
|
||||
end
|
||||
|
||||
if set -q _flag_max_age
|
||||
set -f max_age $_flag_max_age
|
||||
else
|
||||
set -f max_age -1
|
||||
end
|
||||
set -l cache_dir (__fish_make_cache_dir)
|
||||
or return
|
||||
set -l cache_file (path normalize $cache_dir/$cache_key)
|
||||
set -l cache_age (path mtime --relative $cache_file)
|
||||
|
||||
if not test -f $cache_file
|
||||
__fish_cache_put $cache_file
|
||||
sh -c "{ $argv; } >$cache_file || rm $cache_file 2>/dev/null" &
|
||||
|
||||
if test -n "$last_pid"
|
||||
# wait for at most 1 second if supported
|
||||
command --search waitpid &>/dev/null
|
||||
and waitpid --exited --timeout 1 $last_pid
|
||||
and test -f $cache_file
|
||||
and cat $cache_file
|
||||
end
|
||||
else
|
||||
cat $cache_file
|
||||
|
||||
if test $cache_age -gt $max_age
|
||||
__fish_cache_put $cache_file
|
||||
sh -c "{ $argv; } >$cache_file || rm $cache_file 2>/dev/null" &
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -14,15 +14,17 @@ where:
|
||||
set -q prefix[1]
|
||||
or set -l prefix ""
|
||||
set -l pat "$(commandline -t)"
|
||||
#set -l pat $argv[5]
|
||||
if set -q __fish_stripprefix[1]
|
||||
set pat "$(string replace -r -- "$__fish_stripprefix" "" $pat)"
|
||||
end
|
||||
switch $pat
|
||||
case "*$div*"
|
||||
for i in (echo $pat | sed "s/^\(.\+$div\)$iprefix.*\$/\1/")$iprefix(eval $cmd)
|
||||
string unescape -- $i
|
||||
for i in (string unescape -- $pat | sed "s/^\(.\+$div\)$iprefix.*\$/\1/")$iprefix(eval $cmd)
|
||||
printf %s\n $i
|
||||
end
|
||||
case '*'
|
||||
for i in $prefix$iprefix(eval $cmd)
|
||||
string unescape -- $i
|
||||
printf %s\n $i
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
function __fish_complete_pgrep -d 'Complete pgrep/pkill' --argument-names cmd
|
||||
complete -c $cmd -xa '(__fish_complete_proc)'
|
||||
complete -c $cmd -s f -d 'Match pattern against full command line'
|
||||
complete -c $cmd -s g -d 'Only match processes in the process group' -xa '(__fish_complete_list , __fish_complete_groups)'
|
||||
complete -c $cmd -s G -d "Only match processes whose real group ID is listed. Group 0 is translated into $cmd\'s own process group" -xa '(__fish_complete_list , __fish_complete_groups)'
|
||||
complete -c $cmd -s g -d 'Only match processes in the process group' -xa "(__fish_stripprefix='^-\w*g' __fish_complete_list , __fish_complete_groups)"
|
||||
complete -c $cmd -s G -d "Only match processes whose real group ID is listed. Group 0 is translated into $cmd\'s own process group" -xa "(__fish_stripprefix='^-\w*G' __fish_complete_list , __fish_complete_groups)"
|
||||
complete -c $cmd -s n -d 'Select only the newest process'
|
||||
complete -c $cmd -s o -d 'Select only the oldest process'
|
||||
complete -c $cmd -s P -d 'Only match processes whose parent process ID is listed' -xa '(__fish_complete_list , __fish_complete_pids)'
|
||||
complete -c $cmd -s P -d 'Only match processes whose parent process ID is listed' -xa "(__fish_stripprefix='^-\w*P' __fish_complete_list , __fish_complete_pids)"
|
||||
complete -c $cmd -s s -d "Only match processes whose process session ID is listed. Session ID 0 is translated into $cmd\'s own session ID."
|
||||
complete -c $cmd -s t -d 'Only match processes whose controlling terminal is listed. The terminal name should be specified without the "/dev/" prefix' -r
|
||||
complete -c $cmd -s u -d 'Only match processes whose effective user ID is listed' -xa '(__fish_complete_list , __fish_complete_users)'
|
||||
complete -c $cmd -s U -d 'Only match processes whose real user ID is listed' -xa '(__fish_complete_list , __fish_complete_users)'
|
||||
complete -c $cmd -s u -d 'Only match processes whose effective user ID is listed' -xa "(__fish_stripprefix='^-\w*u' __fish_complete_list , __fish_complete_users)"
|
||||
complete -c $cmd -s U -d 'Only match processes whose real user ID is listed' -xa "(__fish_stripprefix='^-\w*U' __fish_complete_list , __fish_complete_users)"
|
||||
complete -c $cmd -s v -d 'Negates the matching'
|
||||
complete -c $cmd -s x -d ' Only match processes whose name (or command line if -f is specified) exactly match the pattern'
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ function __fish_complete_ssh -d "common completions for ssh commands" --argument
|
||||
complete -c $command -s 6 -d "IPv6 only"
|
||||
complete -c $command -s A -d "Enables forwarding of the authentication agent"
|
||||
complete -c $command -s C -d "Compress all data"
|
||||
complete -c $command -s c -d "Encryption algorithm" -xa "(__fish_complete_list , __fish_ssh_ciphers)"
|
||||
complete -c $command -s c -d "Encryption algorithm" -xa "(__fish_stripprefix='^-\w*c' __fish_complete_list , __fish_ssh_ciphers)"
|
||||
complete -c $command -s F -d "Configuration file" -rF
|
||||
complete -c $command -s i -d "Identity key file" -rF
|
||||
complete -c $command -s J -d 'ProxyJump host' -xa "(__fish_complete_user_at_hosts)"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user