mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-20 07:51:14 -03:00
Compare commits
432 Commits
update-def
...
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 | ||
|
|
8c5de9acfb | ||
|
|
75d243faaa | ||
|
|
ba86028aaa | ||
|
|
7a79728df3 | ||
|
|
4cbd1b83f1 | ||
|
|
3ab6fcf21c | ||
|
|
08c8afcb12 | ||
|
|
3951a858dd | ||
|
|
c7a19a00ab | ||
|
|
e5fdd77b09 | ||
|
|
3fcdbe1a19 | ||
|
|
2071df126c | ||
|
|
4b5650ee4f | ||
|
|
5657f093e7 | ||
|
|
a7c04890c9 | ||
|
|
52f23b9752 | ||
|
|
6737872fb7 | ||
|
|
f88f7e8dd6 | ||
|
|
b3dbdb90c2 | ||
|
|
dc129add9e | ||
|
|
19c3bebdd9 | ||
|
|
093b468ac1 | ||
|
|
88bbf5f3ac | ||
|
|
ec8fa7485c | ||
|
|
c2e2237e7c | ||
|
|
98df97d317 | ||
|
|
7ca57894cc | ||
|
|
c7391d1026 | ||
|
|
1963b0830d | ||
|
|
74ce965f32 | ||
|
|
27420aaf8b | ||
|
|
52cdb7fd62 | ||
|
|
18c4debbc0 | ||
|
|
8617964d4d | ||
|
|
0d99859add | ||
|
|
0b8e0b8835 | ||
|
|
3867163193 | ||
|
|
4d84e68dd4 | ||
|
|
285a810814 | ||
|
|
541a069a91 | ||
|
|
e8864ef441 | ||
|
|
2f708a7c0b | ||
|
|
b7a73710e2 | ||
|
|
7a54ed66fb | ||
|
|
99f4c09ed3 | ||
|
|
e26b585ce5 | ||
|
|
7c2c7f5874 | ||
|
|
7b3a2900e9 | ||
|
|
7a79366f91 | ||
|
|
223b98f2ff | ||
|
|
01560bf195 | ||
|
|
7fe34ea401 | ||
|
|
36f035b52c | ||
|
|
0e8edab872 | ||
|
|
448d630d0c | ||
|
|
38fb2cfd6d | ||
|
|
d68f8bdd3b | ||
|
|
80bafd5a22 | ||
|
|
ae8c5eaab7 | ||
|
|
329d190fbf | ||
|
|
e5fa047412 | ||
|
|
cb31887941 | ||
|
|
04fd697ac9 | ||
|
|
2558d13361 | ||
|
|
02ccf25443 | ||
|
|
a88acb9715 | ||
|
|
8d3ad0c3c3 | ||
|
|
660f52ee4f | ||
|
|
594b8730d8 | ||
|
|
107e4d11de | ||
|
|
50500ec5b9 | ||
|
|
3ccce609f0 | ||
|
|
bd26d4b61b | ||
|
|
7f4998ad9b | ||
|
|
122f39de66 | ||
|
|
1df8fbff67 | ||
|
|
ff5ff50183 | ||
|
|
c0d93e4740 | ||
|
|
3cbb5e384b | ||
|
|
90b35335ee | ||
|
|
55752729d6 | ||
|
|
41dfb5147f | ||
|
|
156fa8081c | ||
|
|
3081d0157b | ||
|
|
13e4736113 | ||
|
|
80e30ac756 | ||
|
|
a86a4dfabf | ||
|
|
22bc8e12c9 | ||
|
|
6c23c6f29b | ||
|
|
39fd959eea | ||
|
|
cc2ca60baa | ||
|
|
83f74f9332 | ||
|
|
58af4fa34c | ||
|
|
f23501dbdc | ||
|
|
035cd369c2 | ||
|
|
3bef4863cf | ||
|
|
2d58cfe4cb | ||
|
|
df591a2e0f | ||
|
|
ecefce2ea8 | ||
|
|
786239d280 | ||
|
|
7a668fb17e | ||
|
|
bf2f7ee6c0 | ||
|
|
2f762e2da1 | ||
|
|
11d8b83838 | ||
|
|
c2eaef7273 | ||
|
|
2f278f4bfa | ||
|
|
1e61e6492d | ||
|
|
c993fd022c | ||
|
|
fe10f65587 | ||
|
|
b98c5ee897 | ||
|
|
9ccff5ad5d | ||
|
|
55f70cbb6d | ||
|
|
b7005e8378 | ||
|
|
1f79d48a48 | ||
|
|
e9036774cb | ||
|
|
2cd185a4f1 | ||
|
|
bb92d82c3b | ||
|
|
f9ba834788 | ||
|
|
d23b8af60d | ||
|
|
82eacb6d50 | ||
|
|
c62b09d5d1 | ||
|
|
ccfe949514 | ||
|
|
ccc75d08f3 | ||
|
|
dfac66082a | ||
|
|
9ae01ae00d | ||
|
|
51784b090d | ||
|
|
8115982485 | ||
|
|
d88a656e9e | ||
|
|
d6ee4ec698 | ||
|
|
dbae271fe7 | ||
|
|
a4ec30f298 | ||
|
|
ee9cf33689 | ||
|
|
11b6bf31c0 | ||
|
|
4f0e11383e | ||
|
|
bf78309f79 | ||
|
|
01bd854f25 | ||
|
|
0348389195 | ||
|
|
e05ecd6c7d | ||
|
|
325232bec1 | ||
|
|
b78d168050 | ||
|
|
31edcf029b | ||
|
|
27dc4b3c8a | ||
|
|
77a4f38a13 | ||
|
|
e9d396615b | ||
|
|
79ec558d08 | ||
|
|
719a5d2909 | ||
|
|
93962c82df | ||
|
|
111922b60f | ||
|
|
cb92a5530f | ||
|
|
dd4c04e2ff | ||
|
|
6fec5ab320 | ||
|
|
ada9aff63e | ||
|
|
1d63c1f188 | ||
|
|
a12298152f | ||
|
|
83b10c3919 | ||
|
|
4a3fc5211f | ||
|
|
9f80e1f225 | ||
|
|
9a8d578142 | ||
|
|
09eae92888 | ||
|
|
af6c3eb69f | ||
|
|
dd5864ce13 | ||
|
|
d31dc9ffd8 | ||
|
|
d5e80d43d9 | ||
|
|
0d59e89374 | ||
|
|
8b1f72c54b | ||
|
|
54a5ade57d | ||
|
|
7c25d6a1ba | ||
|
|
a5a5dc46e4 | ||
|
|
1687b3fe7a | ||
|
|
f3ddf793a3 | ||
|
|
647ae7da8c | ||
|
|
0950cd1598 | ||
|
|
a1b1bff97b | ||
|
|
a95be351fb | ||
|
|
91b9bbf651 | ||
|
|
c14e8c1939 | ||
|
|
7e4c3b9fa7 | ||
|
|
8048e38ea4 | ||
|
|
8a5a547d88 | ||
|
|
48704dc612 | ||
|
|
8abab0e2cc | ||
|
|
bd178c8ba8 | ||
|
|
cb719cd418 | ||
|
|
1ff8f983c4 | ||
|
|
e3517f69b3 | ||
|
|
f7bde1354d | ||
|
|
1d69226c58 | ||
|
|
d5e71bc46e | ||
|
|
0d5ab2514c | ||
|
|
bf0a30b9a8 | ||
|
|
b54042e512 | ||
|
|
b7b1753716 | ||
|
|
c0f5fcb089 | ||
|
|
b9f2275349 | ||
|
|
0b97fa7114 | ||
|
|
1a2958d42b | ||
|
|
3e8308f6eb | ||
|
|
ff987f5f76 | ||
|
|
a6fdb41940 | ||
|
|
54971621de | ||
|
|
b6c5f3dc38 |
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
|
||||
|
||||
27
.github/workflows/main.yml
vendored
27
.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,10 +16,10 @@ 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
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect python3-sphinx tmux
|
||||
# Generate a locale that uses a comma as decimal separator.
|
||||
sudo locale-gen fr_FR.UTF-8
|
||||
- name: cmake
|
||||
@@ -32,6 +32,14 @@ jobs:
|
||||
- name: make fish_run_tests
|
||||
run: |
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
- name: translation updates
|
||||
run: |
|
||||
# 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.
|
||||
PATH="$PWD/build:$PATH" build_tools/update_translations.fish --no-mo
|
||||
# Show diff output. Fail if there is any.
|
||||
git --no-pager diff --exit-code || { echo 'There are uncommitted changes after regenerating the gettext PO files. Make sure to update them via `build_tools/update_translations.fish --no-mo` after changing source files.'; exit 1; }
|
||||
|
||||
ubuntu-32bit-static-pcre2:
|
||||
|
||||
@@ -39,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
|
||||
@@ -82,13 +90,14 @@ jobs:
|
||||
- name: Install deps
|
||||
run: |
|
||||
sudo apt install gettext libpcre2-dev python3-pexpect tmux
|
||||
sudo apt install llvm # for llvm-symbolizer
|
||||
- name: cmake
|
||||
env:
|
||||
CC: clang
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
# Rust's ASAN requires the build system to explicitly pass a --target triple. We read that
|
||||
# value from CMake variable Rust_CARGO_TARGET (shared with corrosion).
|
||||
# value from CMake variable Rust_CARGO_TARGET.
|
||||
cmake .. -DASAN=1 -DRust_CARGO_TARGET=x86_64-unknown-linux-gnu -DCMAKE_BUILD_TYPE=Debug
|
||||
- name: make
|
||||
run: |
|
||||
@@ -104,8 +113,8 @@ jobs:
|
||||
# UPDATE: this can cause spurious leak reports for __cxa_thread_atexit_impl() under glibc.
|
||||
LSAN_OPTIONS: verbosity=0:log_threads=0:use_tls=1:print_suppressions=0
|
||||
run: |
|
||||
llvm_version=$(clang --version | awk 'NR==1 { split($NF, version, "."); print version[1] }')
|
||||
export ASAN_SYMBOLIZER_PATH=/usr/bin/llvm-symbolizer-$llvm_version
|
||||
set -x
|
||||
export ASAN_SYMBOLIZER_PATH=$(command -v /usr/bin/llvm-symbolizer* | sort -n | head -1)
|
||||
export LSAN_OPTIONS="$LSAN_OPTIONS:suppressions=$PWD/build_tools/lsan_suppressions.txt"
|
||||
make -C build VERBOSE=1 fish_run_tests
|
||||
|
||||
@@ -119,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
|
||||
@@ -147,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
|
||||
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -38,7 +38,7 @@ Desktop.ini
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
messages.pot
|
||||
*.mo
|
||||
.directory
|
||||
.fuse_hidden*
|
||||
|
||||
@@ -77,6 +77,7 @@ __pycache__
|
||||
/share/__fish_build_paths.fish
|
||||
/share/pkgconfig
|
||||
/tests/*.tmp.*
|
||||
/tests/.last-check-all-files
|
||||
|
||||
# xcode
|
||||
## Build generated
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
fish 4.1.0 (released ???)
|
||||
=========================
|
||||
|
||||
.. ignore for 4.1: 10929 10940 10948 10955 10965 10975 10989 10990 10998 11028 11052 11055 11069 11071 11079 11092 11098 11104 11106 11110 11140 11146 11148 11150 11214 11218 11259 11288 11299 11328 11350 11373 11395 11417 11419
|
||||
|
||||
Notable improvements and fixes
|
||||
------------------------------
|
||||
- Compound commands (``begin; echo 1; echo 2; end``) can now be now be abbreviated using braces (``{ echo1; echo 2 }``), like in other shells.
|
||||
@@ -19,7 +21,7 @@ Notable improvements and fixes
|
||||
|
||||
Deprecations and removed features
|
||||
---------------------------------
|
||||
- Tokens like ``{ echo, echo }`` in command position are no longer interpreted as brace expansion but as compound command.
|
||||
- Tokens like ``{echo,echo}`` or ``{ echo, echo }`` in command position are no longer interpreted as brace expansion but as compound command.
|
||||
- Terminfo-style key names (``bind -k``) are no longer supported. They had been superseded by the native notation since 4.0,
|
||||
and currently they would map back to information from terminfo, which does not match what terminals would send with the kitty keyboard protocol (:issue:`11342`).
|
||||
- fish no longer reads the terminfo database, so its behavior is no longer affected by the :envvar:`TERM` environment variable (:issue:`11344`).
|
||||
@@ -48,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
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
@@ -61,13 +64,16 @@ 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
|
||||
^^^^^^^^^^^
|
||||
- ``git`` completions now show the remote url as a description when completing remotes.
|
||||
- ``systemctl`` completions no longer print escape codes if ``SYSTEMD_COLORS`` is set (:issue:`11465`).
|
||||
|
||||
Improved terminal support
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
- Support for curly underlines in `fish_color_*` variables and :doc:`set_color <cmds/set_color>` (:issue:`10957`).
|
||||
- Support for double, curly, dotted and dashed underlines in `fish_color_*` variables and :doc:`set_color <cmds/set_color>` (:issue:`10957`).
|
||||
- Underlines can now be colored independent of text (:issue:`7619`).
|
||||
- New documentation page `Terminal Compatibility <terminal-compatibility.html>`_ (also accessible via ``man fish-terminal-compatibility``) lists required and optional terminal control sequences used by fish.
|
||||
|
||||
|
||||
@@ -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
|
||||
---------
|
||||
@@ -286,37 +284,62 @@ Contributing Translations
|
||||
Fish uses the GNU gettext library to translate messages from English to
|
||||
other languages.
|
||||
|
||||
Creating and updating translations requires the Gettext tools, including
|
||||
``xgettext``, ``msgfmt`` and ``msgmerge``. Translation sources are
|
||||
Translation sources are
|
||||
stored in the ``po`` directory, named ``LANG.po``, where ``LANG`` is the
|
||||
two letter ISO 639-1 language code of the target language (eg ``de`` for
|
||||
German).
|
||||
two letter ISO 639-1 language code of the target language (e.g. ``de`` for
|
||||
German). A region specifier can also be used (e.g. ``pt_BR`` for Brazilian Portuguese).
|
||||
|
||||
To create a new translation:
|
||||
Adding translations for a new language
|
||||
--------------------------------------
|
||||
|
||||
* generate a ``messages.pot`` file by running ``build_tools/fish_xgettext.fish`` from
|
||||
the source tree
|
||||
* copy ``messages.pot`` to ``po/LANG.po``
|
||||
Creating new translations requires the Gettext tools.
|
||||
More specifically, you will need ``msguniq`` and ``msgmerge`` for creating translations for a new
|
||||
language.
|
||||
To create a new translation, run::
|
||||
|
||||
To update a translation:
|
||||
build_tools/update_translations.fish po/LANG.po
|
||||
|
||||
* generate a ``messages.pot`` file by running
|
||||
``build_tools/fish_xgettext.fish`` from the source tree
|
||||
By default, this also creates ``mo`` files, which contain the information from the ``po`` files in a
|
||||
binary format.
|
||||
Fish uses these files for translating at runtime.
|
||||
They are not tracked in version control, but they can help translators check if their translations
|
||||
show up correctly.
|
||||
If you build fish locally (``cargo build``), and then run the resulting binary,
|
||||
it will make use of the ``mo`` files generated by the script.
|
||||
Use the ``LANG`` environment variable to tell fish which language to use, e.g.::
|
||||
|
||||
* update the existing translation by running
|
||||
``msgmerge --update --no-fuzzy-matching po/LANG.po messages.pot``
|
||||
LANG=pt_BR.utf8 target/debug/fish
|
||||
|
||||
The ``--no-fuzzy-matching`` is important as we have had terrible experiences with gettext's "fuzzy" translations in the past.
|
||||
If you do not care about the ``mo`` files you can pass the ``--no-mo`` flag to the
|
||||
``update_translations.fish`` script.
|
||||
|
||||
Modifying existing translations
|
||||
-------------------------------
|
||||
|
||||
If you want to work on translations for a language which already has a corresponding ``po`` file, it
|
||||
is sufficient to edit this file. No other changes are necessary.
|
||||
|
||||
To see your translations in action you can run::
|
||||
|
||||
build_tools/update_translations.fish --only-mo po/LANG.po
|
||||
|
||||
to update the binary ``mo`` used by fish. Check the information for adding new languages for a
|
||||
description on how you can get fish to use these files.
|
||||
Running this script requires a fish executable and the gettext ``msgfmt`` tool.
|
||||
|
||||
Editing PO files
|
||||
----------------
|
||||
|
||||
Many tools are available for editing translation files, including
|
||||
command-line and graphical user interface programs. For simple use, you can just use your text editor.
|
||||
command-line and graphical user interface programs. For simple use, you can use your text editor.
|
||||
|
||||
Open up the po file, for example ``po/sv.po``, and you'll see something like::
|
||||
|
||||
msgid "%ls: No suitable job\n"
|
||||
msgstr ""
|
||||
msgstr ""
|
||||
|
||||
The ``msgid`` here is the "name" of the string to translate, typically the english string to translate. The second line (``msgstr``) is where your translation goes.
|
||||
The ``msgid`` here is the "name" of the string to translate, typically the English string to translate.
|
||||
The second line (``msgstr``) is where your translation goes.
|
||||
|
||||
For example::
|
||||
|
||||
@@ -329,11 +352,17 @@ Also any escaped characters, like that ``\n`` newline at the end, should be kept
|
||||
|
||||
Our tests run ``msgfmt --check-format /path/to/file``, so they would catch mismatched placeholders - otherwise fish would crash at runtime when the string is about to be used.
|
||||
|
||||
Be cautious about blindly updating an existing translation file. Trivial
|
||||
changes to an existing message (eg changing the punctuation) will cause
|
||||
existing translations to be removed, since the tools do literal string
|
||||
matching. Therefore, in general, you need to carefully review any
|
||||
recommended deletions.
|
||||
Be cautious about blindly updating an existing translation file.
|
||||
``msgid`` strings should never be updated manually, only by running the appropriate script.
|
||||
|
||||
Modifications to strings in source files
|
||||
----------------------------------------
|
||||
|
||||
If a string changes in the sources, the old translations will no longer work.
|
||||
They will be preserved in the ``po`` files, but commented-out (starting with ``#~``).
|
||||
If you add/remove/change a translatable strings in a source file,
|
||||
run ``build_tools/update_translations.fish`` to propagate this to all translation files (``po/*.po``).
|
||||
This is only relevant for developers modifying the source files of fish or fish scripts.
|
||||
|
||||
Setting Code Up For Translations
|
||||
--------------------------------
|
||||
|
||||
42
Cargo.lock
generated
42
Cargo.lock
generated
@@ -89,9 +89,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
|
||||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.10"
|
||||
version = "0.3.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
|
||||
checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"windows-sys",
|
||||
@@ -104,6 +104,7 @@ dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
"errno",
|
||||
"fish-gettext-extraction",
|
||||
"fish-printf",
|
||||
"libc",
|
||||
"lru",
|
||||
@@ -121,11 +122,20 @@ dependencies = [
|
||||
"widestring",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fish-gettext-extraction"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "fish-printf"
|
||||
version = "0.2.1"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"unicode-segmentation",
|
||||
"unicode-width",
|
||||
"widestring",
|
||||
]
|
||||
|
||||
@@ -173,9 +183,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.169"
|
||||
version = "0.2.172"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a"
|
||||
checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa"
|
||||
|
||||
[[package]]
|
||||
name = "lock_api"
|
||||
@@ -216,9 +226,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
||||
|
||||
[[package]]
|
||||
name = "nix"
|
||||
version = "0.29.0"
|
||||
version = "0.30.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
|
||||
checksum = "74523f3a35e05aba87a1d978330aef40f67b0304ac79c1c00b294c9830543db6"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cfg-if",
|
||||
@@ -346,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",
|
||||
]
|
||||
@@ -546,6 +556,18 @@ version = "1.0.14"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-segmentation"
|
||||
version = "1.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd"
|
||||
|
||||
[[package]]
|
||||
name = "unix_path"
|
||||
version = "1.0.1"
|
||||
|
||||
12
Cargo.toml
12
Cargo.toml
@@ -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"
|
||||
|
||||
@@ -40,7 +40,7 @@ libc = "0.2"
|
||||
# disabling default features uses the stdlib instead, but it doubles the time to rewrite the history
|
||||
# files as of 22 April 2024.
|
||||
lru = "0.13.0"
|
||||
nix = { version = "0.29.0", default-features = false, features = [
|
||||
nix = { version = "0.30.1", default-features = false, features = [
|
||||
"event",
|
||||
"inotify",
|
||||
"resource",
|
||||
@@ -49,6 +49,7 @@ nix = { version = "0.29.0", 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
|
||||
@@ -99,7 +100,7 @@ embed-data = ["dep:rust-embed"]
|
||||
asan = []
|
||||
tsan = []
|
||||
|
||||
[lints]
|
||||
[workspace.lints]
|
||||
rust.non_camel_case_types = "allow"
|
||||
rust.non_upper_case_globals = "allow"
|
||||
rust.unknown_lints = "allow"
|
||||
@@ -113,3 +114,6 @@ clippy.needless_lifetimes = "allow"
|
||||
# In the future, they might change to flag other methods of printing.
|
||||
clippy.print_stdout = "deny"
|
||||
clippy.print_stderr = "deny"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
35
SECURITY.md
Normal file
35
SECURITY.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Security Reporting
|
||||
|
||||
If you wish to report a security vulnerability privately, we appreciate your diligence. Please follow the guidelines below to submit your report.
|
||||
|
||||
## Reporting
|
||||
|
||||
To report a security vulnerability, please provide the following information:
|
||||
|
||||
1. **PROJECT**
|
||||
|
||||
- Include the URL of the project repository - Example: <https://github.com/fish-shell/fish-shell>
|
||||
|
||||
2. **PUBLIC**
|
||||
|
||||
- Indicate whether this vulnerability has already been publicly discussed or disclosed.
|
||||
- If so, provide relevant links.
|
||||
|
||||
3. **DESCRIPTION**
|
||||
- Provide a detailed description of the security vulnerability.
|
||||
- Include as much information as possible to help us understand and address the issue.
|
||||
|
||||
Send this information, along with any additional relevant details, to <rf@fishshell.com>.
|
||||
|
||||
## Confidentiality
|
||||
|
||||
We kindly ask you to keep the report confidential until a public announcement is made.
|
||||
|
||||
## Notes
|
||||
|
||||
- Vulnerabilities will be handled on a best-effort basis.
|
||||
- You may request an advance copy of the patched release, but we cannot guarantee early access before the public release.
|
||||
- You will be notified via email simultaneously with the public announcement.
|
||||
- We will respond within a few weeks to confirm whether your report has been accepted or rejected.
|
||||
|
||||
Thank you for helping to improve the security of our project!
|
||||
67
build.rs
67
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
|
||||
@@ -143,9 +146,9 @@ fn detect_apple(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(any(target_os = "ios", target_os = "macos")))
|
||||
}
|
||||
|
||||
#[allow(unexpected_cfgs)]
|
||||
fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(target_os = "cygwin"))
|
||||
// Cygwin target is usually cross-compiled.
|
||||
Ok(std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "cygwin")
|
||||
}
|
||||
|
||||
/// Detect if we're being compiled for a BSD-derived OS, allowing targeting code conditionally with
|
||||
@@ -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
|
||||
}
|
||||
15
build_tools/diff_profiles.fish
Normal file → Executable file
15
build_tools/diff_profiles.fish
Normal file → Executable file
@@ -5,6 +5,13 @@
|
||||
#
|
||||
# Usage: ./diff_profiles.fish profile1.log profile2.log > profile_diff.log
|
||||
|
||||
if test (count $argv) -ne 2
|
||||
|
||||
echo "Incorrect number of arguments."
|
||||
echo "Usage: "(status filename)" profile1.log profile2.log"
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l profile1 (cat $argv[1])
|
||||
set -l profile2 (cat $argv[2])
|
||||
|
||||
@@ -15,13 +22,13 @@ while set -l next_line_no (math $line_no + 1) && set -q profile1[$next_line_no]
|
||||
set -l line1 $profile1[$line_no]
|
||||
set -l line2 $profile2[$line_no]
|
||||
|
||||
if not string match -qr '^\d+\t\d+' $line1
|
||||
if not string match -qr '^\s*\d+\s+\d+' $line1
|
||||
echo $line1
|
||||
continue
|
||||
end
|
||||
|
||||
set -l results1 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line1)
|
||||
set -l results2 (string match -r '^(\d+)\t(\d+)\s+(.*)' $line2)
|
||||
set -l results1 (string match -r '^\s*(\d+)\s+(\d+)\s+(.*)' $line1)
|
||||
set -l results2 (string match -r '^\s*(\d+)\s+(\d+)\s+(.*)' $line2)
|
||||
|
||||
# times from both files
|
||||
set -l time1 $results1[2..3]
|
||||
@@ -42,5 +49,5 @@ while set -l next_line_no (math $line_no + 1) && set -q profile1[$next_line_no]
|
||||
set diff[1] (math $time1[1] - $time2[1])
|
||||
set diff[2] (math $time1[2] - $time2[2])
|
||||
|
||||
echo $diff[1] $diff[2] $remainder1
|
||||
printf '%10d %10d %s\n' $diff[1] $diff[2] $remainder1
|
||||
end
|
||||
|
||||
@@ -1,68 +1,87 @@
|
||||
#!/usr/bin/env fish
|
||||
#
|
||||
# Tool to generate messages.pot
|
||||
# Tool to generate gettext messages template file.
|
||||
# Writes to stdout.
|
||||
# Intended to be called from `update_translations.fish`.
|
||||
|
||||
# Create temporary directory for these operations. OS X `mktemp` is somewhat restricted, so this block
|
||||
# works around that - based on share/functions/funced.fish.
|
||||
set -q TMPDIR
|
||||
or set -l TMPDIR /tmp
|
||||
set -l tmpdir (mktemp -d $TMPDIR/fish.XXXXXX)
|
||||
or exit 1
|
||||
argparse use-existing-template= -- $argv
|
||||
or exit $status
|
||||
|
||||
# This is a gigantic crime.
|
||||
# xgettext still does not support rust *at all*, so we use cargo-expand to get all our wgettext invocations.
|
||||
set -l expanded (cargo expand --lib; for f in fish{,_indent,_key_reader}; cargo expand --bin $f; end)
|
||||
begin
|
||||
# Write header. This is required by msguniq.
|
||||
# Note that this results in the file being overwritten.
|
||||
# This is desired behavior, to get rid of the results of prior invocations
|
||||
# of this script.
|
||||
begin
|
||||
echo 'msgid ""'
|
||||
echo 'msgstr ""'
|
||||
echo '"Content-Type: text/plain; charset=UTF-8\n"'
|
||||
echo ""
|
||||
end
|
||||
|
||||
# Extract any gettext call
|
||||
set -l strs (printf '%s\n' $expanded | grep -A1 wgettext_static_str |
|
||||
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 "\'" "'" | sort -u)
|
||||
set -g repo_root (status dirname)/..
|
||||
|
||||
# Extract any constants
|
||||
set -a strs (string match -rv 'BUILD_VERSION:|PACKAGE_NAME' -- $expanded |
|
||||
string match -rg 'const [A-Z_]*: &str = "(.*)"' | string replace -a "\'" "'")
|
||||
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
|
||||
|
||||
# We construct messages.pot ourselves instead of forcing this into msgmerge or whatever.
|
||||
# The escaping so far works out okay.
|
||||
for str in $strs
|
||||
# grep -P needed for string escape to be compatible (PCRE-style),
|
||||
# -H gives the filename, -n the line number.
|
||||
# If you want to run this on non-GNU grep: Don't.
|
||||
echo "#:" (grep -PHn -r -- (string escape --style=regex -- $str) src/ |
|
||||
head -n1 | string replace -r ':\s.*' '')
|
||||
echo "msgid \"$str\""
|
||||
echo 'msgstr ""'
|
||||
end >messages.pot
|
||||
# Get rid of duplicates and sort.
|
||||
msguniq --no-wrap --strict --sort-output $rust_extraction_file
|
||||
or exit 1
|
||||
|
||||
# This regex handles descriptions for `complete` and `function` statements. These messages are not
|
||||
# particularly important to translate. Hence the "implicit" label.
|
||||
set -l implicit_regex '(?:^| +)(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
|
||||
if not set -l --query _flag_use_existing_template
|
||||
rm $rust_extraction_file
|
||||
end
|
||||
|
||||
# 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) *\).*'
|
||||
function extract_fish_script_messages --argument-names regex
|
||||
|
||||
mkdir -p $tmpdir/implicit/share/completions $tmpdir/implicit/share/functions
|
||||
mkdir -p $tmpdir/explicit/share/completions $tmpdir/explicit/share/functions
|
||||
# Using xgettext causes more trouble than it helps.
|
||||
# This is due to handling of escaping in fish differing from formats xgettext understands
|
||||
# (e.g. POSIX shell strings).
|
||||
# We work around this issue by manually writing the file content.
|
||||
|
||||
for f in share/config.fish share/completions/*.fish share/functions/*.fish
|
||||
# Extract explicit attempts to translate a message. That is, those that are of the form
|
||||
# `(_ "message")`.
|
||||
string replace --filter --regex $explicit_regex '$1' <$f | string unescape \
|
||||
| string replace --all '"' '\\"' | string replace -r '(.*)' 'N_ "$1"' >$tmpdir/explicit/$f
|
||||
# Steps:
|
||||
# 1. We extract strings to be translated from the relevant files and drop the rest. This step
|
||||
# depends on the regex matching the entire line, and the first capture group matching the
|
||||
# string.
|
||||
# 2. We unescape. This gets rid of some escaping necessary in fish strings.
|
||||
# 3. The resulting strings are sorted alphabetically. This step is optional. Not sorting would
|
||||
# result in strings from the same file appearing together. Removing duplicates is also
|
||||
# optional, since msguniq takes care of that later on as well.
|
||||
# 4. Single backslashes are replaced by double backslashes. This results in the backslashes
|
||||
# being interpreted as literal backslashes by gettext tooling.
|
||||
# 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_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
|
||||
|
||||
# Handle `complete` / `function` description messages. The `| fish` is subtle. It basically
|
||||
# avoids the need to use `source` with a command substitution that could affect the current
|
||||
# shell.
|
||||
string replace --filter --regex $implicit_regex '$1' <$f | string unescape \
|
||||
| string replace --all '"' '\\"' | string replace -r '(.*)' 'N_ "$1"' >$tmpdir/implicit/$f
|
||||
end
|
||||
set -g share_dir $repo_root/share
|
||||
|
||||
xgettext -j -k -kN_ -LShell --from-code=UTF-8 -cDescription --no-wrap -o messages.pot $tmpdir/{ex,im}plicit/share/*/*.fish
|
||||
# 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) *\).*'
|
||||
extract_fish_script_messages $explicit_regex
|
||||
|
||||
# Remove the tmpdir from the location to avoid churn
|
||||
sed -i 's_^#: /.*/share/_#: share/_' messages.pot
|
||||
|
||||
rm -r $tmpdir
|
||||
# This regex handles descriptions for `complete` and `function` statements. These messages are not
|
||||
# particularly important to translate. Hence the "implicit" label.
|
||||
set -l implicit_regex '^(?:\s|and |or )*(?:complete|function).*? (?:-d|--description) (([\'"]).+?(?<!\\\\)\\2).*'
|
||||
extract_fish_script_messages $implicit_regex
|
||||
end |
|
||||
# At this point, all extracted strings have been written to stdout,
|
||||
# starting with the ones taken from the Rust sources,
|
||||
# followed by strings explicitly marked for translation in fish scripts,
|
||||
# and finally the strings from fish scripts which get translated implicitly.
|
||||
# Because we do not eliminate duplicates across these categories,
|
||||
# we do it here, since other gettext tools expect no duplicates.
|
||||
msguniq --no-wrap
|
||||
|
||||
@@ -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
|
||||
|
||||
145
build_tools/update_translations.fish
Executable file
145
build_tools/update_translations.fish
Executable file
@@ -0,0 +1,145 @@
|
||||
#!/usr/bin/env fish
|
||||
|
||||
# Updates the files used for gettext translations.
|
||||
# By default, the whole xgettext, msgmerge, msgfmt pipeline runs,
|
||||
# which extracts the messages from the source files into $template_file,
|
||||
# updates the PO files for each language from that
|
||||
# (changed line numbers, added messages, removed messages),
|
||||
# and finally generates a machine-readable MO file for each language,
|
||||
# which is stored in share/locale/$LANG/LC_MESSAGES/fish.mo (relative to the repo root).
|
||||
#
|
||||
# Use cases:
|
||||
# For developers:
|
||||
# - Run with args `--no-mo` to update all PO files after making changes to Rust/fish
|
||||
# sources.
|
||||
# For translators:
|
||||
# - Run with `--no-mo` first, to ensure that the strings you are translating are up to date.
|
||||
# - 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 -g tmpdir
|
||||
set -l po_dir $build_tools/../po
|
||||
|
||||
set -l extract
|
||||
set -l po
|
||||
set -l mo
|
||||
|
||||
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]
|
||||
# Update everything if not specified otherwise.
|
||||
set -g po_files $po_dir/*.po
|
||||
else
|
||||
set -l po_dir_id (stat --format='%d:%i' -- $po_dir)
|
||||
for arg in $argv
|
||||
set -l arg_dir_id (stat --format='%d:%i' -- (dirname $arg))
|
||||
if test $po_dir_id != $arg_dir_id
|
||||
echo "Argument $arg is not a file in the directory $(realpath $po_dir)."
|
||||
echo "Non-option arguments must specify paths to files in this directory."
|
||||
echo ""
|
||||
echo "If you want to add a new language to the translations not the following:"
|
||||
echo "The filename must identify a language, with a two letter ISO 639-1 language code of the target language (e.g. 'pt' for Portuguese), and use the file extension '.po'."
|
||||
echo "Optionally, you can specify a regional variant (e.g. 'pt_BR')."
|
||||
echo "So valid filenames are of the shape 'll.po' or 'll_CC.po'."
|
||||
exit 1
|
||||
end
|
||||
if not basename $arg | grep -qE '^[a-z]{2}(_[A-Z]{2})?\.po$'
|
||||
echo "Filename does not match the expected format ('ll.po' or 'll_CC.po')."
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
set -g po_files $argv
|
||||
end
|
||||
|
||||
if set -l --query _flag_no_mo
|
||||
set -l --erase mo
|
||||
end
|
||||
if set -l --query _flag_only_mo
|
||||
set -l --erase extract
|
||||
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
|
||||
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 --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
|
||||
end
|
||||
if set -l --query mo
|
||||
set -l locale_dir $build_tools/../share/locale
|
||||
set -l out_dir $locale_dir/(basename $po_file .po)/LC_MESSAGES
|
||||
mkdir -p $out_dir
|
||||
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")
|
||||
|
||||
1
debian/control
vendored
1
debian/control
vendored
@@ -27,7 +27,6 @@ Depends: bsdextrautils | bsdmainutils,
|
||||
gettext-base,
|
||||
# for nroff and preconv
|
||||
groff-base,
|
||||
man-db,
|
||||
# for terminal definitions
|
||||
ncurses-base,
|
||||
# for kill
|
||||
|
||||
@@ -425,6 +425,24 @@ Launch ``git diff`` and repaint the commandline afterwards when :kbd:`ctrl-g` is
|
||||
|
||||
bind ctrl-g 'git diff' repaint
|
||||
|
||||
Swap :kbd:`tab` and :kbd:`shift-tab`, making tab focus the search field.
|
||||
But if the search field is already active, keep the behavior (:kbd:`tab` cycles forward, :kbd:`shift-tab` backward).::
|
||||
|
||||
bind tab '
|
||||
if commandline --search-field >/dev/null
|
||||
commandline -f complete
|
||||
else
|
||||
commandline -f complete-and-search
|
||||
end
|
||||
'
|
||||
bind shift-tab '
|
||||
if commandline --search-field >/dev/null
|
||||
commandline -f complete-and-search
|
||||
else
|
||||
commandline -f complete
|
||||
end
|
||||
'
|
||||
|
||||
.. _cmd-bind-termlimits:
|
||||
|
||||
Terminal Limitations
|
||||
|
||||
@@ -74,6 +74,9 @@ The following options change what part of the commandline is printed or updated:
|
||||
**--search-field**
|
||||
Use the pager search field instead of the command line. Returns false if the search field is not shown.
|
||||
|
||||
**--input=INPUT**
|
||||
Operate on this string instead of the commandline. Useful for using options like **--tokens-expanded**.
|
||||
|
||||
The following options change the way ``commandline`` prints the current commandline buffer:
|
||||
|
||||
**-c** or **--cut-at-cursor**
|
||||
@@ -87,10 +90,7 @@ The following options change the way ``commandline`` prints the current commandl
|
||||
Perform argument expansion on the selection and print one argument per line.
|
||||
Command substitutions are not expanded but forwarded as-is.
|
||||
|
||||
**--tokens-raw**
|
||||
Print arguments in the selection as they appear on the command line, one per line.
|
||||
|
||||
**-o** or **tokenize**
|
||||
**-o**, **tokenize**, **--tokens-raw**
|
||||
Deprecated; do not use.
|
||||
|
||||
If ``commandline`` is called during a call to complete a given string using ``complete -C STRING``, ``commandline`` will consider the specified string to be the current contents of the command line.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -22,7 +22,7 @@ Description
|
||||
|
||||
The ``fish_mode_prompt`` function outputs the mode indicator for use in vi mode.
|
||||
|
||||
The default ``fish_mode_prompt`` function will output indicators about the current vi editor mode displayed to the left of the regular prompt. Define your own function to customize the appearance of the mode indicator. The ``$fish_bind_mode variable`` can be used to determine the current mode. It will be one of ``default``, ``insert``, ``replace_one``, or ``visual``.
|
||||
The default ``fish_mode_prompt`` function will output indicators about the current vi editor mode displayed to the left of the regular prompt. Define your own function to customize the appearance of the mode indicator. The ``$fish_bind_mode variable`` can be used to determine the current mode. It will be one of ``default``, ``insert``, ``replace_one``, ``replace``, or ``visual``.
|
||||
|
||||
You can also define an empty ``fish_mode_prompt`` function to remove the vi mode indicators::
|
||||
|
||||
@@ -51,6 +51,9 @@ Example
|
||||
case replace_one
|
||||
set_color --bold green
|
||||
echo 'R'
|
||||
case replace
|
||||
set_color --bold bryellow
|
||||
echo 'R'
|
||||
case visual
|
||||
set_color --bold brmagenta
|
||||
echo 'V'
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -57,7 +57,7 @@ The following options are available:
|
||||
Sets reverse mode.
|
||||
|
||||
**-u** or **--underline**, or **-uSTYLE** or **--underline=STYLE**
|
||||
Set the underline mode; supported styles are **single** (default) and **curly**.
|
||||
Set the underline mode; supported styles are **single** (default), **double**, **curly**, **dotted** and **dashed**.
|
||||
|
||||
**-h** or **--help**
|
||||
Displays help about using this command.
|
||||
|
||||
@@ -8,8 +8,8 @@ Synopsis
|
||||
|
||||
.. synopsis::
|
||||
|
||||
string join [-q | --quiet] SEP [STRING ...]
|
||||
string join0 [-q | --quiet] [STRING ...]
|
||||
string join [-q | --quiet] [-n | --no-empty] [--] SEP [STRING ...]
|
||||
string join0 [-q | --quiet] [-n | --no-empty] [--] [STRING ...]
|
||||
|
||||
.. END SYNOPSIS
|
||||
|
||||
@@ -18,11 +18,28 @@ Description
|
||||
|
||||
.. BEGIN DESCRIPTION
|
||||
|
||||
``string join`` joins its *STRING* arguments into a single string separated by *SEP*, which can be an empty string. Exit status: 0 if at least one join was performed, or 1 otherwise. If ``-n`` or ``--no-empty`` is specified, empty strings are excluded from consideration (e.g. ``string join -n + a b "" c`` would expand to ``a+b+c`` not ``a+b++c``).
|
||||
Joins its *STRING* arguments into a single string separated by *SEP* (for ``string join``) or by the
|
||||
zero byte (NUL) (for ``string join0``).
|
||||
Exit status: 0 if at least one join was performed, or 1 otherwise.
|
||||
|
||||
``string join0`` joins its *STRING* arguments into a single string separated by the zero byte (NUL), and adds a trailing NUL. This is most useful in conjunction with tools that accept NUL-delimited input, such as ``sort -z``. Exit status: 0 if at least one join was performed, or 1 otherwise.
|
||||
**-n**, **--no-empty**
|
||||
Exclude empty strings from consideration (e.g. ``string join -n + a b "" c`` would expand to ``a+b+c`` not ``a+b++c``).
|
||||
|
||||
Because Unix uses NUL as the string terminator, passing the output of ``string join0`` as an *argument* to a command (via a :ref:`command substitution <expand-command-substitution>`) won't actually work. Fish will pass the correct bytes along, but the command won't be able to tell where the argument ends. This is a limitation of Unix' argument passing.
|
||||
**-q**, **--quiet**
|
||||
Do not print the strings, only set the exit status as described above.
|
||||
|
||||
**WARNING**:
|
||||
Insert a ``--`` before positional arguments to prevent them from being interpreted as flags.
|
||||
Otherwise, any strings starting with ``-`` will be treated as flag arguments, meaning they will most likely result in the command failing.
|
||||
This is also true if you specify a variable which expands to such a string instead of a literal string.
|
||||
If you don't need to append flag arguments at the end of the command,
|
||||
just always use ``--`` to avoid unwelcome surprises.
|
||||
|
||||
``string join0`` adds a trailing NUL. This is most useful in conjunction with tools that accept NUL-delimited input, such as ``sort -z``.
|
||||
|
||||
Because Unix uses NUL as the string terminator, passing the output of ``string join0`` as an *argument* to a command (via a :ref:`command substitution <expand-command-substitution>`) won't actually work.
|
||||
Fish will pass the correct bytes along, but the command won't be able to tell where the argument ends.
|
||||
This is a limitation of Unix' argument passing.
|
||||
|
||||
.. END DESCRIPTION
|
||||
|
||||
@@ -43,4 +60,14 @@ Examples
|
||||
>_ string join '' a b c
|
||||
abc
|
||||
|
||||
>_ set -l markdown_list '- first' '- second' '- third'
|
||||
# Strings with leading hyphens (also in variable expansions) are interpreted as flag arguments by default.
|
||||
>_ string join \n $markdown_list
|
||||
string join: - first: unknown option
|
||||
# Use '--' to prevent this.
|
||||
>_ string join -- \n $markdown_list
|
||||
- first
|
||||
- second
|
||||
- third
|
||||
|
||||
.. END EXAMPLES
|
||||
|
||||
@@ -11,7 +11,7 @@ Synopsis
|
||||
string collect [-a | --allow-empty] [-N | --no-trim-newlines] [STRING ...]
|
||||
string escape [-n | --no-quoted] [--style=] [STRING ...]
|
||||
string join [-q | --quiet] [-n | --no-empty] SEP [STRING ...]
|
||||
string join0 [-q | --quiet] [STRING ...]
|
||||
string join0 [-q | --quiet] [-n | --no-empty] [STRING ...]
|
||||
string length [-q | --quiet] [STRING ...]
|
||||
string lower [-q | --quiet] [STRING ...]
|
||||
string match [-a | --all] [-e | --entire] [-i | --ignore-case]
|
||||
@@ -27,7 +27,7 @@ Synopsis
|
||||
[-r | --regex] [-q | --quiet] PATTERN REPLACE [STRING ...]
|
||||
string shorten [(-c | --char) CHARS] [(-m | --max) INTEGER]
|
||||
[-N | --no-newline] [-l | --left] [-q | --quiet] [STRING ...]
|
||||
string split [(-f | --fields) FIELDS] [(-m | --max) MAX] [-n | --no-empty]
|
||||
string split [(-f | --fields) FIELDS] [(-m | --max) MAX] [-n | --no-empty]
|
||||
[-q | --quiet] [-r | --right] SEP [STRING ...]
|
||||
string split0 [(-f | --fields) FIELDS] [(-m | --max) MAX] [-n | --no-empty]
|
||||
[-q | --quiet] [-r | --right] [STRING ...]
|
||||
|
||||
@@ -354,7 +354,7 @@ Some bindings are common across Emacs and vi mode, because they aren't text edit
|
||||
|
||||
- :kbd:`alt-o` opens the file at the cursor in a pager. If the cursor is in command position and the command is a script, it will instead open that script in your editor. The editor is chosen from the first available of the ``$VISUAL`` or ``$EDITOR`` variables.
|
||||
|
||||
- :kbd:`alt-p` adds the string ``&| less;`` to the end of the job under the cursor. The result is that the output of the command will be paged.
|
||||
- :kbd:`alt-p` adds the string ``&| less;`` to the end of the job under the cursor. The result is that the output of the command will be paged. If you set the ``PAGER`` variable, its value is used instead of ``less``.
|
||||
|
||||
- :kbd:`alt-w` prints a short description of the command under the cursor.
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -917,6 +917,12 @@ If there is nothing between a brace and a comma or two commas, it's interpreted
|
||||
|
||||
To use a "," as an element, :ref:`quote <quotes>` or :ref:`escape <escapes>` it.
|
||||
|
||||
The very first character of a command token is never interpreted as expanding brace, because it's the beginning of a :ref:`compound statement <cmd-begin>`::
|
||||
|
||||
> {echo hello, && echo world}
|
||||
hello,
|
||||
world
|
||||
|
||||
.. _cartesian-product:
|
||||
|
||||
Combining lists
|
||||
|
||||
@@ -120,10 +120,22 @@ Optional Commands
|
||||
- smul
|
||||
- Enter underline mode.
|
||||
-
|
||||
* - ``\e[4:2m``
|
||||
- Su
|
||||
- Enter double underline mode.
|
||||
- kitty
|
||||
* - ``\e[4:3m``
|
||||
- Su
|
||||
- Enter curly underline mode.
|
||||
- kitty
|
||||
* - ``\e[4:4m``
|
||||
- Su
|
||||
- Enter dotted underline mode.
|
||||
- kitty
|
||||
* - ``\e[4:5m``
|
||||
- Su
|
||||
- Enter dashed underline mode.
|
||||
- kitty
|
||||
* - ``\e[7m``
|
||||
- rev
|
||||
- Enter reverse video mode (swap foreground and background colors).
|
||||
|
||||
@@ -115,7 +115,7 @@ These colors, and many more, can be changed by running ``fish_config``, or by mo
|
||||
|
||||
For example, if you want to disable (almost) all coloring::
|
||||
|
||||
fish_config theme choose none
|
||||
fish_config theme choose None
|
||||
|
||||
This picks the "none" theme. To see all themes::
|
||||
|
||||
@@ -631,12 +631,12 @@ You can define your own prompt from the command line:
|
||||
|
||||
Then, if you are happy with it, you can save it to disk by typing ``funcsave fish_prompt``. This saves the prompt in ``~/.config/fish/functions/fish_prompt.fish``. (Or, if you want, you can create that file manually from the start.)
|
||||
|
||||
Multiple lines are OK. Colors can be set via :doc:`set_color <cmds/set_color>`, passing it named ANSI colors, or hex RGB values::
|
||||
Multiple lines are OK. Colors can be set via :doc:`set_color <cmds/set_color>` by passing it named ANSI colors, or hex RGB values::
|
||||
|
||||
function fish_prompt
|
||||
set_color purple
|
||||
date "+%m/%d/%y"
|
||||
set_color F00
|
||||
set_color FF0000
|
||||
echo (pwd) '>' (set_color normal)
|
||||
end
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -31,13 +31,12 @@ BuildRequires: glibc-langpack-en
|
||||
BuildRequires: python3 procps
|
||||
|
||||
%if 0%{?suse_version}
|
||||
Requires: terminfo-base
|
||||
Requires: terminfo-base groff
|
||||
%else
|
||||
Requires: ncurses-base
|
||||
Requires: ncurses-base groff-base
|
||||
%endif
|
||||
Requires: file
|
||||
Requires: python3
|
||||
Requires: man
|
||||
Requires: procps
|
||||
|
||||
# Although the build scripts mangle the version number to be RPM compatible
|
||||
|
||||
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
|
||||
}
|
||||
182216
po/pt_BR.po
182216
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
181520
po/zh_CN.po
181520
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
@@ -1,11 +1,17 @@
|
||||
[package]
|
||||
name = "fish-printf"
|
||||
edition = "2021"
|
||||
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"
|
||||
|
||||
[dependencies]
|
||||
libc = "0.2.155"
|
||||
widestring = { version = "1.0.2", optional = true }
|
||||
unicode-segmentation = "1.12.0"
|
||||
unicode-width = "0.2.0"
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
1
printf/clippy.toml
Normal file
1
printf/clippy.toml
Normal file
@@ -0,0 +1 @@
|
||||
allow-print-in-tests = true
|
||||
@@ -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.
|
||||
|
||||
@@ -71,7 +71,7 @@ macro_rules! sprintf {
|
||||
/// - `args`: Iterator over the arguments to format.
|
||||
///
|
||||
/// # Returns
|
||||
/// A `Result` which is `Ok` containing the number of characters written on success, or an `Error`.
|
||||
/// A `Result` which is `Ok` containing the width of the string written on success, or an `Error`.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
use std::fmt::{self, Write};
|
||||
use std::mem;
|
||||
use std::result::Result;
|
||||
use unicode_segmentation::UnicodeSegmentation;
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
||||
#[cfg(feature = "widestring")]
|
||||
use widestring::Utf32Str as wstr;
|
||||
@@ -382,7 +384,7 @@ pub fn sprintf_locale(
|
||||
}
|
||||
|
||||
// Read field width. We do not support $.
|
||||
let width = if s.at(0) == Some('*') {
|
||||
let desired_width = if s.at(0) == Some('*') {
|
||||
let arg_width = args.next().ok_or(Error::MissingArg)?.as_sint()?;
|
||||
s.advance_by(1);
|
||||
if arg_width < 0 {
|
||||
@@ -397,7 +399,7 @@ pub fn sprintf_locale(
|
||||
};
|
||||
|
||||
// Optionally read precision. We do not support $.
|
||||
let mut prec: Option<usize> = if s.at(0) == Some('.') && s.at(1) == Some('*') {
|
||||
let mut desired_precision: Option<usize> = if s.at(0) == Some('.') && s.at(1) == Some('*') {
|
||||
// "A negative precision is treated as though it were missing."
|
||||
// Here we assume the precision is always signed.
|
||||
s.advance_by(2);
|
||||
@@ -410,7 +412,7 @@ pub fn sprintf_locale(
|
||||
None
|
||||
};
|
||||
// Disallow precisions larger than i32::MAX, in keeping with C.
|
||||
if prec.unwrap_or(0) > i32::MAX as usize {
|
||||
if desired_precision.unwrap_or(0) > i32::MAX as usize {
|
||||
return Err(Error::Overflow);
|
||||
}
|
||||
|
||||
@@ -429,7 +431,7 @@ pub fn sprintf_locale(
|
||||
// "If a precision is given with a numeric conversion (d, i, o, u, i, x, and X),
|
||||
// the 0 flag is ignored." p is included here.
|
||||
let spec_is_numeric = matches!(conv_spec, CS::d | CS::u | CS::o | CS::p | CS::x | CS::X);
|
||||
if spec_is_numeric && prec.is_some() {
|
||||
if spec_is_numeric && desired_precision.is_some() {
|
||||
flags.zero_pad = false;
|
||||
}
|
||||
|
||||
@@ -443,17 +445,26 @@ pub fn sprintf_locale(
|
||||
CS::e | CS::f | CS::g | CS::a | CS::E | CS::F | CS::G | CS::A => {
|
||||
// Floating point types handle output on their own.
|
||||
let float = arg.as_float()?;
|
||||
let len = format_float(f, float, width, prec, flags, locale, conv_spec, buf)?;
|
||||
let len = format_float(
|
||||
f,
|
||||
float,
|
||||
desired_width,
|
||||
desired_precision,
|
||||
flags,
|
||||
locale,
|
||||
conv_spec,
|
||||
buf,
|
||||
)?;
|
||||
out_len = out_len.checked_add(len).ok_or(Error::Overflow)?;
|
||||
continue 'main;
|
||||
}
|
||||
CS::p => {
|
||||
const PTR_HEX_DIGITS: usize = 2 * mem::size_of::<*const u8>();
|
||||
prec = prec.map(|p| p.max(PTR_HEX_DIGITS));
|
||||
desired_precision = desired_precision.map(|p| p.max(PTR_HEX_DIGITS));
|
||||
let uint = arg.as_uint()?;
|
||||
if uint != 0 {
|
||||
prefix = "0x";
|
||||
write!(buf, "{:x}", uint)?;
|
||||
write!(buf, "{uint:x}")?;
|
||||
}
|
||||
buf
|
||||
}
|
||||
@@ -467,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
|
||||
@@ -477,17 +488,17 @@ 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 && prec.unwrap_or(0) <= buf.len() + 1 {
|
||||
prec = Some(buf.len() + 1);
|
||||
if flags.alt_form && desired_precision.unwrap_or(0) <= buf.len() + 1 {
|
||||
desired_precision = Some(buf.len() + 1);
|
||||
}
|
||||
buf
|
||||
}
|
||||
CS::u => {
|
||||
let uint = arg.as_uint()?;
|
||||
if uint != 0 {
|
||||
write!(buf, "{}", uint)?;
|
||||
write!(buf, "{uint}")?;
|
||||
}
|
||||
buf
|
||||
}
|
||||
@@ -514,10 +525,38 @@ pub fn sprintf_locale(
|
||||
CS::s => {
|
||||
// also 'S'
|
||||
let s = arg.as_str(buf)?;
|
||||
let p = prec.unwrap_or(s.len()).min(s.len());
|
||||
prec = Some(p);
|
||||
flags.zero_pad = false;
|
||||
&s[..p]
|
||||
match desired_precision {
|
||||
Some(precision) => {
|
||||
// from man printf(3)
|
||||
// "the maximum number of characters to be printed from a string"
|
||||
// We interpret this to mean the maximum width when printed, as defined by
|
||||
// Unicode grapheme cluster width.
|
||||
let mut byte_len = 0;
|
||||
let mut width = 0;
|
||||
let mut graphemes = s.graphemes(true);
|
||||
// Iteratively add single grapheme clusters as long as the fit within the
|
||||
// width limited by precision.
|
||||
while width < precision {
|
||||
match graphemes.next() {
|
||||
Some(grapheme) => {
|
||||
let grapheme_width = grapheme.width();
|
||||
if width + grapheme_width <= precision {
|
||||
byte_len += grapheme.len();
|
||||
width += grapheme_width;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
None => break,
|
||||
}
|
||||
}
|
||||
let p = precision.min(width);
|
||||
desired_precision = Some(p);
|
||||
&s[..byte_len]
|
||||
}
|
||||
None => s,
|
||||
}
|
||||
}
|
||||
};
|
||||
// Numeric output should be empty iff the value is 0.
|
||||
@@ -528,23 +567,26 @@ pub fn sprintf_locale(
|
||||
// Decide if we want to apply thousands grouping to the body, and compute its size.
|
||||
// Note we have already errored out if grouped is set and this is non-numeric.
|
||||
let wants_grouping = flags.grouped && locale.thousands_sep.is_some();
|
||||
let body_len = match wants_grouping {
|
||||
let body_width = match wants_grouping {
|
||||
// We assume that text representing numbers is ASCII, so len == width.
|
||||
true => body.len() + locale.separator_count(body.len()),
|
||||
false => body.len(),
|
||||
false => body.width(),
|
||||
};
|
||||
|
||||
// Resolve the precision.
|
||||
// In the case of a non-numeric conversion, update the precision to at least the
|
||||
// length of the string.
|
||||
let prec = if !spec_is_numeric {
|
||||
prec.unwrap_or(body_len)
|
||||
let desired_precision = if !spec_is_numeric {
|
||||
desired_precision.unwrap_or(body_width)
|
||||
} else {
|
||||
prec.unwrap_or(1).max(body_len)
|
||||
desired_precision.unwrap_or(1).max(body_width)
|
||||
};
|
||||
|
||||
let prefix_len = prefix.len();
|
||||
let unpadded_width = prefix_len.checked_add(prec).ok_or(Error::Overflow)?;
|
||||
let width = width.max(unpadded_width);
|
||||
let prefix_width = prefix.width();
|
||||
let unpadded_width = prefix_width
|
||||
.checked_add(desired_precision)
|
||||
.ok_or(Error::Overflow)?;
|
||||
let width = desired_width.max(unpadded_width);
|
||||
|
||||
// Pad on the left with spaces to the desired width?
|
||||
if !flags.left_adj && !flags.zero_pad {
|
||||
@@ -560,7 +602,8 @@ pub fn sprintf_locale(
|
||||
}
|
||||
|
||||
// Pad on the left to the given precision?
|
||||
pad(f, '0', prec, body_len)?;
|
||||
// TODO: why pad with 0 here?
|
||||
pad(f, '0', desired_precision, body_width)?;
|
||||
|
||||
// Output the actual value, perhaps with grouping.
|
||||
if wants_grouping {
|
||||
|
||||
@@ -13,6 +13,7 @@ macro_rules! sprintf_check {
|
||||
$(,)? // optional trailing comma
|
||||
) => {
|
||||
{
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
let mut target = String::new();
|
||||
let mut args = [$($arg.to_arg()),*];
|
||||
let len = $crate::printf_c_locale(
|
||||
@@ -20,7 +21,7 @@ macro_rules! sprintf_check {
|
||||
$fmt.as_ref() as &str,
|
||||
&mut args,
|
||||
).expect("printf failed");
|
||||
assert!(len == target.len(), "Wrong length returned: {} vs {}", len, target.len());
|
||||
assert_eq!(len, target.width(), "Wrong length returned");
|
||||
target
|
||||
}
|
||||
};
|
||||
@@ -735,6 +736,18 @@ fn test_huge_precision_g() {
|
||||
sprintf_err!("%.2147483648g", f => Error::Overflow);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_non_ascii() {
|
||||
assert_fmt!("%3s", "ö" => " ö");
|
||||
assert_fmt!("%3s", "🇺🇳" => " 🇺🇳");
|
||||
assert_fmt!("%.3s", "🇺🇳🇺🇳" => "🇺🇳");
|
||||
assert_fmt!("%.3s", "a🇺🇳" => "a🇺🇳");
|
||||
assert_fmt!("%.3s", "aa🇺🇳" => "aa");
|
||||
assert_fmt!("%3.3s", "aa🇺🇳" => " aa");
|
||||
assert_fmt!("%.1s", "𒈙a" => "𒈙");
|
||||
assert_fmt!("%3.3s", "👨👨👧👧" => " 👨👨👧👧");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_errors() {
|
||||
use Error::*;
|
||||
@@ -877,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'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
function __fish_apt_no_subcommand -d 'Test if apt has yet to be given the subcommand'
|
||||
for i in (commandline -xpc)
|
||||
if contains -- $i update upgrade dselect-upgrade dist-upgrade install remove purge source build-dep check clean autoclean changelog
|
||||
if contains -- $i update upgrade dselect-upgrade dist-upgrade install remove purge autoremove autopurge source build-dep check clean autoclean changelog
|
||||
return 1
|
||||
end
|
||||
end
|
||||
@@ -11,7 +11,7 @@ end
|
||||
|
||||
function __fish_apt_use_package -d 'Test if apt command should have packages as potential completion'
|
||||
for i in (commandline -xpc)
|
||||
if contains -- $i contains install remove purge build-dep changelog
|
||||
if contains -- $i contains install remove purge autoremove autopurge build-dep changelog
|
||||
return 0
|
||||
end
|
||||
end
|
||||
@@ -34,7 +34,8 @@ complete -f -n __fish_apt_no_subcommand -c apt-get -a build-dep -d 'Install/remo
|
||||
complete -f -n __fish_apt_no_subcommand -c apt-get -a check -d 'Update cache and check dependencies'
|
||||
complete -f -n __fish_apt_no_subcommand -c apt-get -a clean -d 'Clean local caches and packages'
|
||||
complete -f -n __fish_apt_no_subcommand -c apt-get -a autoclean -d 'Clean packages no longer be downloaded'
|
||||
complete -f -n __fish_apt_no_subcommand -c apt-get -a autoremove -d 'Remove automatically installed packages'
|
||||
complete -f -n __fish_apt_no_subcommand -c apt-get -a autoremove -d 'Remove packages no longer needed as dependencies'
|
||||
complete -f -n __fish_apt_no_subcommand -c apt-get -a autopurge -d 'Remove packages no longer needed as dependencies and delete their config files'
|
||||
complete -c apt-get -l no-install-recommends -d 'Do not install recommended packages'
|
||||
complete -c apt-get -l no-install-suggests -d 'Do not install suggested packages'
|
||||
complete -c apt-get -s d -l download-only -d 'Download Only'
|
||||
|
||||
@@ -6,8 +6,8 @@ if [ "$(uname -s)" = Darwin -a "$(command -s apt)" = /usr/bin/apt ]
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l all_subcmds update upgrade full-upgrade search list install show remove edit-sources purge changelog autoremove depends rdepends
|
||||
set -l pkg_subcmds install upgrade full-upgrade show search purge changelog policy depends rdepends autoremove
|
||||
set -l all_subcmds update upgrade full-upgrade search list install show remove edit-sources purge changelog autoremove autopurge depends rdepends
|
||||
set -l pkg_subcmds install upgrade full-upgrade show search purge changelog policy depends rdepends autoremove autopurge
|
||||
set -l installed_pkg_subcmds remove
|
||||
set -l handle_file_pkg_subcmds install
|
||||
|
||||
@@ -114,7 +114,7 @@ __fish_apt_subcommand changelog -r -d 'Download and display package changelog'
|
||||
# Autoremove
|
||||
__fish_apt_subcommand autoremove -d 'Remove packages no longer needed as dependencies'
|
||||
|
||||
# Autoremove
|
||||
# Autopurge
|
||||
__fish_apt_subcommand autopurge -d 'Remove packages no longer needed as dependencies and delete their config files'
|
||||
|
||||
# Clean
|
||||
|
||||
@@ -11,7 +11,7 @@ end
|
||||
|
||||
function __fish_apt_use_package -d 'Test if aptitude command should have packages as potential completion'
|
||||
for i in (commandline -xpc)
|
||||
if contains -- $i changelog full-upgrade download forbid-version hold install keep-all markauto purge reinstall remove show unhold unmarkauto
|
||||
if contains -- $i changelog full-upgrade download forbid-version hold install keep-all markauto purge reinstall remove show showrc unhold unmarkauto why why-not versions
|
||||
return 0
|
||||
end
|
||||
end
|
||||
@@ -38,15 +38,19 @@ complete -f -n __fish_apt_no_subcommand -c aptitude -a markauto -d 'Mark package
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a purge -d 'Remove and delete all associated configuration and data files'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a reinstall -d 'Reinstall the packages'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a remove -d 'Remove the packages'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a showsrc -d 'Display detailed information about the source packages (apt wrapper)'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a show -d 'Display detailed information about the packages'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a unhold -d 'Consider the packages by future upgrade commands'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a unmarkauto -d 'Mark packages as manually installed'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a search -d 'Search for packages matching one of the patterns'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a help -d 'Display brief summary of the available commands and options'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a why -d 'Explain why a particular package should be installed'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a why-not -d 'Explain why a particular package cannot be installed'
|
||||
complete -f -n __fish_apt_no_subcommand -c aptitude -a versions -d 'Displays the versions of specified packages'
|
||||
|
||||
complete -c aptitude -s D -l show-deps -d 'Show explanations of automatic installations and removals'
|
||||
complete -c aptitude -s d -l download-only -d 'Download Only'
|
||||
complete -c aptitude -s f -l fix-broken -d 'Correct broken dependencies'
|
||||
complete -c aptitude -s d -l download-only -d 'Download only'
|
||||
complete -c aptitude -s f -l fix-broken -d 'Aggressively try to fix broken packages'
|
||||
complete -c aptitude -l purge-unused -d 'Purge packages that are not required by any installed package'
|
||||
complete -c aptitude -s P -l prompt -d 'Always display a prompt'
|
||||
complete -c aptitude -s R -l without-recommends -d 'Do not treat recommendations as dependencies'
|
||||
@@ -60,6 +64,7 @@ complete -c aptitude -l version -d 'Display the version of aptitude and compile
|
||||
complete -c aptitude -l visual-preview -d 'Start up the visual interface and display its preview screen'
|
||||
complete -c aptitude -s y -l assume-yes -d 'Assume the answer yes for all question prompts'
|
||||
complete -c aptitude -s Z -d 'Show how much disk space will be used or freed'
|
||||
complete -c aptitude -s u -d 'Download new package lists on startup (terminal interface only)'
|
||||
complete -r -c aptitude -s F -l display-format -d 'Specify the format to be used by the search command'
|
||||
complete -r -c aptitude -s t -l target-release -d 'Set the release from which packages should be installed'
|
||||
complete -r -c aptitude -s O -l sort -d 'Specify the order for the output from the search command'
|
||||
|
||||
@@ -1,20 +1,25 @@
|
||||
# Tab completion for cargo (https://github.com/rust-lang/cargo).
|
||||
|
||||
## --- WRITTEN MANUALLY ---
|
||||
set -l __fish_cargo_subcommands (cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s*(.*)' '$1\t$2' | string escape)
|
||||
|
||||
function __fish_cargo
|
||||
cargo --color=never $argv
|
||||
end
|
||||
|
||||
set -l __fish_cargo_subcommands (__fish_cargo --list 2>&1 | string replace -rf '^\s+([^\s]+)\s*(.*)' '$1\t$2' | string escape)
|
||||
|
||||
complete -c cargo -f -c cargo -n __fish_use_subcommand -a "$__fish_cargo_subcommands"
|
||||
complete -c cargo -x -c cargo -n '__fish_seen_subcommand_from help' -a "$__fish_cargo_subcommands"
|
||||
|
||||
for x in bench b build c check rustc t test
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -a "(cargo bench --bench 2>&1 | string replace -rf '^\s+' '')"
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bench -a "(__fish_cargo bench --bench 2>&1 | string replace -rf '^\s+' '')"
|
||||
complete -c cargo -n "__fish_seen_subcommand_from $x" -l lib -d 'Only this package\'s library'
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l test -a "(cargo test --test 2>&1 | string replace -rf '^\s+' '')"
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l test -a "(__fish_cargo test --test 2>&1 | string replace -rf '^\s+' '')"
|
||||
end
|
||||
|
||||
for x in bench b build c check r run rustc t test
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bin -a "(cargo run --bin 2>&1 | string replace -rf '^\s+' '')"
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -a "(cargo run --example 2>&1 | string replace -rf '^\s+' '')"
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l bin -a "(__fish_cargo run --bin 2>&1 | string replace -rf '^\s+' '')"
|
||||
complete -c cargo -x -n "__fish_seen_subcommand_from $x" -l example -a "(__fish_cargo run --example 2>&1 | string replace -rf '^\s+' '')"
|
||||
end
|
||||
|
||||
# If using rustup, get the list of installed targets from there. Otherwise print all targets.
|
||||
@@ -38,18 +43,18 @@ end
|
||||
|
||||
function __fish_cargo_features
|
||||
if command -q jq
|
||||
cargo read-manifest | jq -r '.features | keys | .[]' | __fish_concat_completions
|
||||
__fish_cargo read-manifest | jq -r '.features | keys | .[]' | __fish_concat_completions
|
||||
else if set -l python (__fish_anypython)
|
||||
cargo read-manifest | command $python -Sc "import sys, json"\n"print(*json.load(sys.stdin)['features'].keys(), sep='\n')" | __fish_concat_completions
|
||||
__fish_cargo read-manifest | command $python -Sc "import sys, json"\n"print(*json.load(sys.stdin)['features'].keys(), sep='\n')" | __fish_concat_completions
|
||||
end
|
||||
end
|
||||
|
||||
function __fish_cargo_packages
|
||||
if command -q jq
|
||||
cargo metadata --no-deps --format-version 1 | jq -r '.packages | .[] | .name' | __fish_concat_completions
|
||||
__fish_cargo metadata --no-deps --format-version 1 | jq -r '.packages | .[] | .name' | __fish_concat_completions
|
||||
else if set -l python (__fish_anypython)
|
||||
cargo metadata --no-deps --format-version 1 |
|
||||
command $python -Sc "import sys, json"\n"print(*[x['name'] for x in json.load(sys.stdin)['packages']], sep='\n')"
|
||||
__fish_cargo metadata --no-deps --format-version 1 |
|
||||
command $python -Sc "import sys, json"\n"print(*[x['name'] for x in json.load(sys.stdin)['packages']], sep='\n')"
|
||||
end
|
||||
end
|
||||
complete -c cargo -n '__fish_seen_subcommand_from run test build debug check clippy' -s p -l package \
|
||||
@@ -60,7 +65,7 @@ complete -c cargo -n '__fish_seen_subcommand_from run test build debug check cli
|
||||
complete -c cargo -n __fish_use_subcommand -l explain -d 'Run `rustc --explain CODE`'
|
||||
complete -c cargo -n __fish_use_subcommand -l color -d 'Coloring: auto, always, never'
|
||||
complete -c cargo -n __fish_use_subcommand -l config -d 'Override a configuration value (unstable)'
|
||||
complete -c cargo -n __fish_use_subcommand -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' -xa '(cargo -Z help | string replace -rf \'^\s*-Z (\S+)\s+(.*)\' \'$1\t$2\')'
|
||||
complete -c cargo -n __fish_use_subcommand -s Z -d 'Unstable (nightly-only) flags to Cargo, see \'cargo -Z help\' for details' -xa '(__fish_cargo -Z help | string replace -rf \'^\s*-Z (\S+)\s+(.*)\' \'$1\t$2\')'
|
||||
complete -c cargo -n __fish_use_subcommand -s V -l version -d 'Print version info and exit'
|
||||
complete -c cargo -n __fish_use_subcommand -l list -d 'List installed commands'
|
||||
complete -c cargo -n __fish_use_subcommand -s v -l verbose -d 'Use verbose output (-vv very verbose/build.rs output)'
|
||||
@@ -718,7 +723,7 @@ complete -c cargo -n "__fish_seen_subcommand_from tree" -s v -l verbose -d 'Use
|
||||
complete -c cargo -n "__fish_seen_subcommand_from tree" -l frozen -d 'Require Cargo.lock and cache are up to date'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from tree" -l locked -d 'Require Cargo.lock is up to date'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from tree" -l offline -d 'Run without accessing the network'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -fa '(cargo install --list | string replace -rf "(\S+) (.*):" \'$1\t$2\')'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -fa '(__fish_cargo install --list | string replace -rf "(\S+) (.*):" \'$1\t$2\')'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -s p -l package -d 'Package to uninstall'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l bin -d 'Only uninstall the binary NAME'
|
||||
complete -c cargo -n "__fish_seen_subcommand_from uninstall" -l root -d 'Directory to uninstall packages from'
|
||||
@@ -841,8 +846,8 @@ if command -q cargo-asm
|
||||
# Warning: this will build the project and can take time! We make sure to only call it if it's not a switch so completions
|
||||
# for --foo will always be fast.
|
||||
if command -q timeout
|
||||
complete -c cargo -n "__fish_seen_subcommand_from asm; and not __fish_is_switch" -xa "(timeout 1 cargo asm)"
|
||||
complete -c cargo -n "__fish_seen_subcommand_from asm; and not __fish_is_switch" -xa "(timeout 1 __fish_cargo asm)"
|
||||
else
|
||||
complete -c cargo -n "__fish_seen_subcommand_from asm; and not __fish_is_switch" -xa "(cargo asm)"
|
||||
complete -c cargo -n "__fish_seen_subcommand_from asm; and not __fish_is_switch" -xa "(__fish_cargo asm)"
|
||||
end
|
||||
end
|
||||
|
||||
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"
|
||||
|
||||
@@ -13,7 +13,6 @@ complete -c commandline -s b -l current-buffer -d "Select entire command line (d
|
||||
complete -c commandline -s c -l cut-at-cursor -d "Only return that part of the command line before the cursor"
|
||||
complete -c commandline -s f -l function -d "Inject readline functions to reader"
|
||||
complete -c commandline -s x -l tokens-expanded -d "Print a list of expanded tokens"
|
||||
complete -c commandline -l tokens-raw -d "Print a list of raw tokens"
|
||||
|
||||
complete -c commandline -s I -l input -d "Specify command to operate on"
|
||||
complete -c commandline -s C -l cursor -d "Set/get cursor position, not buffer contents"
|
||||
|
||||
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
|
||||
|
||||
@@ -52,8 +52,8 @@ end
|
||||
function __fish_git_branches
|
||||
# This is much faster than using `git branch` and avoids dealing with localized "detached HEAD" messages.
|
||||
# We intentionally only sort local branches by recency. See discussion in #9248.
|
||||
__fish_git for-each-ref --format='%(refname:strip=2)%09Local Branch' --sort=-committerdate refs/heads/ 2>/dev/null
|
||||
__fish_git for-each-ref --format='%(refname:strip=2)%09Remote Branch' refs/remotes/ 2>/dev/null
|
||||
__fish_git_local_branches
|
||||
__fish_git_remote_branches
|
||||
end
|
||||
|
||||
function __fish_git_submodules
|
||||
@@ -65,6 +65,10 @@ function __fish_git_local_branches
|
||||
__fish_git for-each-ref --format='%(refname:strip=2)%09Local Branch' --sort=-committerdate refs/heads/ 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_git_remote_branches
|
||||
__fish_git for-each-ref --format='%(refname:strip=2)%09Remote Branch' refs/remotes/ 2>/dev/null
|
||||
end
|
||||
|
||||
function __fish_git_unique_remote_branches
|
||||
# `git checkout` accepts remote branches without the remote part
|
||||
# if they are unambiguous.
|
||||
@@ -72,7 +76,7 @@ function __fish_git_unique_remote_branches
|
||||
# `git checkout frobulate` is equivalent to `git checkout -b frobulate --track alice/frobulate`.
|
||||
__fish_git for-each-ref --format="%(refname:strip=3)" \
|
||||
--sort="refname:strip=3" \
|
||||
"refs/remotes/*/$match*" "refs/remotes/*/*/**" 2>/dev/null | uniq -u
|
||||
refs/remotes/ 2>/dev/null | uniq -u
|
||||
end
|
||||
|
||||
function __fish_git_tags
|
||||
@@ -82,13 +86,20 @@ end
|
||||
function __fish_git_heads
|
||||
set -l gitdir (__fish_git rev-parse --git-dir 2>/dev/null)
|
||||
or return # No git dir, no need to even test.
|
||||
for head in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD
|
||||
for head in HEAD FETCH_HEAD ORIG_HEAD MERGE_HEAD REBASE_HEAD REVERT_HEAD \
|
||||
CHERRY_PICK_HEAD BISECT_HEAD AUTO_MERGE
|
||||
if test -f $gitdir/$head
|
||||
echo $head
|
||||
end
|
||||
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
|
||||
@@ -96,7 +107,27 @@ function __fish_git_refs
|
||||
end
|
||||
|
||||
function __fish_git_remotes
|
||||
__fish_git remote 2>/dev/null
|
||||
# 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 config --get-regexp 'remote\.[a-z]+\.url' | string replace -rf 'remote\.(.*)\.url (.*)' '$1\t$2'
|
||||
end
|
||||
|
||||
set -g __fish_git_recent_commits_arg
|
||||
set -g __fish_git_unqualified_unique_remote_branches false
|
||||
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 $__fish_git_recent_commits_arg $__fish_git_filter_non_pushable)"
|
||||
$c "(__fish_git_tags)" -d Tag
|
||||
$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'
|
||||
end
|
||||
$c "(__fish_git_local_branches)" -d 'Local Branch'
|
||||
end
|
||||
|
||||
function __fish_git_files
|
||||
@@ -647,6 +678,7 @@ function __fish_git_aliased_command
|
||||
end
|
||||
end
|
||||
|
||||
set -g __fish_git_aliases
|
||||
git config -z --get-regexp 'alias\..*' | while read -lz alias cmdline
|
||||
set -l command (__fish_git_aliased_command $cmdline)
|
||||
string match -q --regex '\w+' -- $command; or continue
|
||||
@@ -772,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
|
||||
@@ -784,7 +817,7 @@ end
|
||||
|
||||
# Suggest branches for the specified remote - returns 1 if no known remote is specified
|
||||
function __fish_git_branch_for_remote
|
||||
set -l remotes (__fish_git_remotes)
|
||||
set -l remotes (__fish_git remote 2>/dev/null)
|
||||
set -l remote
|
||||
set -l cmd (commandline -xpc)
|
||||
for r in $remotes
|
||||
@@ -1034,7 +1067,7 @@ complete -f -c git -n '__fish_git_using_command fetch' -l shallow-since -d 'Deep
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l shallow-exclude -d 'Deepen history of shallow clone, excluding rev'
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l unshallow -d 'Convert to a complete repository'
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l refetch -d 'Re-fetch without negotiating common commits'
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l negotiation-tip -d 'Only report commits reachable from these tips' -kxa '(__fish_git_commits; __fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command fetch' -l negotiation-tip -d 'Only report commits reachable from these tips' -x
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l negotiate-only -d "Don't fetch, only show commits in common with the server"
|
||||
complete -f -c git -n '__fish_git_using_command fetch' -l filter -ra '(__fish_git_filters)' -d 'Request a subset of objects from server'
|
||||
|
||||
@@ -1087,10 +1120,8 @@ complete -f -c git -n "__fish_git_using_command remote" -n "__fish_seen_subcomma
|
||||
|
||||
### show
|
||||
complete -f -c git -n __fish_git_needs_command -a show -d 'Show the last commit of a branch'
|
||||
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_branches)'
|
||||
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_tags)' -d Tag
|
||||
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_commits)'
|
||||
complete -f -c git -n '__fish_git_using_command show' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_complete_stashes)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command show'
|
||||
complete -f -c git -n __fish_git_needs_rev_files -n 'not contains -- -- (commandline -xpc)' -xa '(__fish_git_complete_rev_files)'
|
||||
complete -F -c git -n '__fish_git_using_command show' -n 'contains -- -- (commandline -xpc)'
|
||||
complete -f -c git -n '__fish_git_using_command show' -l format -d 'Pretty-print the contents of the commit logs in a given format' -a '(__fish_git_show_opt format)'
|
||||
@@ -1179,13 +1210,12 @@ complete -c git -n '__fish_git_using_command am' -l show-current-patch -a 'diff
|
||||
### checkout
|
||||
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_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
|
||||
|
||||
# The following dynamic, order-preserved (-k) completions will be shown in reverse order (see #9221)
|
||||
complete -f -c git -n '__fish_git_using_command checkout' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_recent_commits --all)'
|
||||
complete -f -c git -n '__fish_git_using_command checkout' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_tags)' -d Tag
|
||||
complete -f -c git -n '__fish_git_using_command checkout' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_heads)' -d Head
|
||||
complete -f -c git -n '__fish_git_using_command checkout' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch'
|
||||
complete -f -c git -n '__fish_git_using_command checkout' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_branches)'
|
||||
# In the presence of changed files, `git checkout ...` assumes highest likelihood is intent to restore so this comes last (aka shown first).
|
||||
complete -f -c git -n '__fish_git_using_command checkout' -ka '(__fish_git_files modified deleted modified-staged-deleted)'
|
||||
|
||||
@@ -1354,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'
|
||||
@@ -1422,9 +1481,7 @@ complete -x -c git -n '__fish_git_using_command daemon' -l access-hook -d 'Hook
|
||||
|
||||
### describe
|
||||
complete -c git -n __fish_git_needs_command -a describe -d 'Give an object a human readable name'
|
||||
complete -f -c git -n '__fish_git_using_command describe' -ka '(__fish_git_tags)' -d Tag
|
||||
complete -f -c git -n '__fish_git_using_command describe' -ka '(__fish_git_branches)'
|
||||
complete -f -c git -n '__fish_git_using_command describe' -ka '(__fish_git_heads)' -d Head
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command describe'
|
||||
complete -f -c git -n '__fish_git_using_command describe' -l dirty -d 'Describe the state of the working tree, append dirty if there are local changes'
|
||||
complete -f -c git -n '__fish_git_using_command describe' -l broken -d 'Describe the state of the working tree, append -broken instead of erroring'
|
||||
complete -f -c git -n '__fish_git_using_command describe' -l all -d 'Use all tags, not just annotated'
|
||||
@@ -1444,7 +1501,10 @@ complete -f -c git -n '__fish_git_using_command describe' -l first-parent -d 'Fo
|
||||
complete -c git -n __fish_git_needs_command -a diff -d 'Show changes between commits and working tree'
|
||||
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)'
|
||||
complete -c git -n '__fish_git_using_command diff' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_recent_commits --all)'
|
||||
begin
|
||||
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'
|
||||
complete -c git -n '__fish_git_using_command diff' -l staged -d 'Show diff of changes in the index'
|
||||
complete -c git -n '__fish_git_using_command diff' -l no-index -d 'Compare two paths on the filesystem'
|
||||
@@ -1775,7 +1835,7 @@ complete -f -c git -n '__fish_git_using_command maintenance' -l schedule -d 'Run
|
||||
|
||||
### merge
|
||||
complete -f -c git -n __fish_git_needs_command -a merge -d 'Join multiple development histories'
|
||||
complete -f -c git -n '__fish_git_using_command merge' -ka '(__fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command merge'
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l commit -d "Autocommit the merge"
|
||||
complete -f -c git -n '__fish_git_using_command merge' -l no-commit -d "Don't autocommit the merge"
|
||||
complete -f -c git -n '__fish_git_using_command merge' -s e -l edit -d 'Edit auto-generated merge message'
|
||||
@@ -1811,7 +1871,7 @@ complete -f -c git -n '__fish_git_using_command merge' -l no-autostash -d 'Do no
|
||||
|
||||
### merge-base
|
||||
complete -f -c git -n __fish_git_needs_command -a merge-base -d 'Find a common ancestor for a merge'
|
||||
complete -f -c git -n '__fish_git_using_command merge-base' -ka '(__fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command merge-base'
|
||||
complete -f -c git -n '__fish_git_using_command merge-base' -s a -l all -d 'Output all merge bases for the commits, instead of just one'
|
||||
complete -f -c git -n '__fish_git_using_command merge-base' -l octopus -d 'Compute the best common ancestors of all supplied commits'
|
||||
complete -f -c git -n '__fish_git_using_command merge-base' -l independent -d 'Print a minimal subset of the supplied commits with the same ancestors'
|
||||
@@ -1929,9 +1989,10 @@ complete -f -c git -n '__fish_git_using_command range-diff' -l no-dual-color -d
|
||||
### push
|
||||
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'
|
||||
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -ka '(__fish_git_tags)' -d Tag
|
||||
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -ka '(__fish_git_branches)'
|
||||
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -ka '(__fish_git_heads)'
|
||||
begin
|
||||
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
|
||||
complete -f -c git -n '__fish_git_using_command push' -n __fish_git_branch_for_remote -n 'string match -q "+*" -- (commandline -ct)' -ka '+(__fish_git_branches | string replace -r \t".*" "")' -d 'Force-push branch'
|
||||
# git push REMOTE :BRANCH deletes BRANCH on remote REMOTE
|
||||
@@ -1958,16 +2019,13 @@ complete -f -c git -n '__fish_git_using_command push' -l progress -d 'Force prog
|
||||
|
||||
### rebase
|
||||
complete -f -c git -n __fish_git_needs_command -a rebase -d 'Reapply commit sequence on a new base'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_remotes)' -d 'Remote alias'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -ka '(__fish_git_branches)'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_heads)' -d Head
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -ka '(__fish_git_tags)' -d Tag -k
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -a '(__fish_git_recent_commits)' -k
|
||||
__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'
|
||||
@@ -1987,7 +2045,7 @@ complete -f -c git -n '__fish_git_using_command rebase' -l no-autosquash -d 'No
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l autostash -d 'Before starting rebase, stash local changes, and apply stash when done'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l no-autostash -d 'Do not stash local changes before starting rebase'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l no-ff -d 'No fast-forward'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l onto -d 'Rebase current branch onto given upstream or newbase' -ka '(__fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command rebase' -l onto -d 'Rebase current branch onto given upstream or newbase' -r
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l update-refs -d 'Update any branches that point to commits being rebased'
|
||||
complete -f -c git -n '__fish_git_using_command rebase' -l no-update-refs -d 'Don\'t update any branches that point to commits being rebased'
|
||||
# This actually takes script for $SHELL, but completing that is... complicated.
|
||||
@@ -2006,7 +2064,7 @@ complete -c git -n __fish_git_needs_command -a reset -d 'Reset current HEAD to t
|
||||
complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset the index and the working tree'
|
||||
complete -f -c git -n '__fish_git_using_command reset' -l soft -d 'Reset head without touching the index or the working tree'
|
||||
complete -f -c git -n '__fish_git_using_command reset' -l mixed -d 'The default: reset the index but not the working tree'
|
||||
complete -c git -n '__fish_git_using_command reset' -n 'not contains -- -- (commandline -xpc)' -ka '(__fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command reset'
|
||||
# reset can either undo changes to versioned modified files,
|
||||
# or remove files from the staging area.
|
||||
# Deleted files seem to need a "--" separator.
|
||||
@@ -2038,7 +2096,10 @@ complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_unique_
|
||||
complete -f -c git -n '__fish_git_using_command switch' -ka '(__fish_git_branches)'
|
||||
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'
|
||||
complete -f -c git -n '__fish_git_using_command switch' -s d -l detach -rka '(__fish_git_recent_commits --all)'
|
||||
begin
|
||||
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)'
|
||||
complete -f -c git -n '__fish_git_using_command switch' -l guess -d 'Guess branch name from remote branch (default)'
|
||||
complete -f -c git -n '__fish_git_using_command switch' -l no-guess -d 'Do not guess branch name from remote branch'
|
||||
@@ -2063,9 +2124,7 @@ complete -f -c git -n __fish_git_needs_command -a rev-list -d 'List commits in c
|
||||
|
||||
### rev-parse
|
||||
complete -f -c git -n __fish_git_needs_command -a rev-parse -d 'Parse revision names or give repo information'
|
||||
complete -f -c git -n '__fish_git_using_command rev-parse' -ka '(__fish_git_branches)'
|
||||
complete -f -c git -n '__fish_git_using_command rev-parse' -a '(__fish_git_heads)' -d Head
|
||||
complete -c git -n '__fish_git_using_command rev-parse' -ka '(__fish_git_tags)' -d Tag
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command rev-parse'
|
||||
complete -c git -n '__fish_git_using_command rev-parse' -l abbrev-ref -d 'Output non-ambiguous short object names'
|
||||
|
||||
### revert
|
||||
@@ -2115,7 +2174,7 @@ complete -f -c git -n '__fish_git_using_command stripspace' -s c -l comment-line
|
||||
|
||||
### tag
|
||||
complete -f -c git -n __fish_git_needs_command -a tag -d 'Create, list, delete or verify a tag object signed with GPG'
|
||||
complete -f -c git -n '__fish_git_using_command tag' -n '__fish_not_contain_opt -s d' -n '__fish_not_contain_opt -s v' -n 'test (count (commandline -xpc | string match -r -v \'^-\')) -eq 3' -ka '(__fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command tag' -n '__fish_not_contain_opt -s d' -n '__fish_not_contain_opt -s v' -n 'test (count (commandline -xpc | string match -r -v \'^-\')) -eq 3'
|
||||
complete -f -c git -n '__fish_git_using_command tag' -s a -l annotate -d 'Make an unsigned, annotated tag object'
|
||||
complete -f -c git -n '__fish_git_using_command tag' -s s -l sign -d 'Make a GPG-signed tag'
|
||||
complete -f -c git -n '__fish_git_using_command tag' -s d -l delete -d 'Remove a tag'
|
||||
@@ -2176,11 +2235,10 @@ complete -f -c git -n "__fish_git_using_command worktree" -n "not __fish_seen_su
|
||||
complete -f -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add move remove' -s f -l force -d 'Override safeguards'
|
||||
|
||||
complete -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add'
|
||||
complete -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -ka '(__fish_git_branches)'
|
||||
complete -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -ka '(__fish_git_heads)' -d Head
|
||||
complete -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -ka '(__fish_git_tags)' -d Tag
|
||||
complete -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -ka '(__fish_git_unique_remote_branches)' -d 'Unique Remote Branch'
|
||||
complete -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -ka '(__fish_git_local_branches)'
|
||||
begin
|
||||
set -lx __fish_git_unqualified_unique_remote_branches true
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add'
|
||||
end
|
||||
complete -x -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -s b -d 'Create a new branch'
|
||||
complete -x -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -s B -d 'Create a new branch even if it already exists'
|
||||
complete -f -c git -n '__fish_git_using_command worktree' -n '__fish_seen_subcommand_from add' -l detach -d 'Detach HEAD in the new working tree'
|
||||
@@ -2216,11 +2274,7 @@ complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_u
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a branch -d 'Create a new branch from a stash'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n __fish_git_stash_not_using_subcommand -a push -d 'Create a new stash with given files'
|
||||
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command apply' -ka '(__fish_git_complete_stashes)'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command branch' -ka '(__fish_git_complete_stashes)'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command drop' -ka '(__fish_git_complete_stashes)'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command pop' -ka '(__fish_git_complete_stashes)'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command show' -ka '(__fish_git_complete_stashes)'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command apply branch drop pop show' -ka '(__fish_git_complete_stashes)'
|
||||
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -a '(__fish_git_files modified deleted modified-staged-deleted)'
|
||||
complete -f -c git -n '__fish_git_using_command stash' -n '__fish_git_stash_using_command push' -s a -l all -d 'Stash ignored and untracked files'
|
||||
@@ -2237,7 +2291,7 @@ complete -f -c git -n __fish_git_needs_command -a config -d 'Set and read git co
|
||||
|
||||
### format-patch
|
||||
complete -f -c git -n __fish_git_needs_command -a format-patch -d 'Generate patch series to send upstream'
|
||||
complete -f -c git -n '__fish_git_using_command format-patch' -ka '(__fish_git_branches)'
|
||||
__fish_git_add_revision_completion -n '__fish_git_using_command format-patch'
|
||||
complete -c git -n '__fish_git_using_command format-patch' -s o -l output-directory -xa '(__fish_complete_directories)'
|
||||
complete -f -c git -n '__fish_git_using_command format-patch' -s p -l no-stat -d "Generate plain patches without diffstat"
|
||||
complete -f -c git -n '__fish_git_using_command format-patch' -s s -l no-patch -d "Suppress diff output"
|
||||
@@ -2589,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
|
||||
@@ -2599,3 +2654,8 @@ for file in (path filter -xZ $PATH/git-* | path basename)
|
||||
complete -c git -f -n "__fish_git_using_command $cmd" -a "(__fish_git_complete_custom_command $cmd)"
|
||||
set -a __fish_git_custom_commands_completion $file
|
||||
end
|
||||
|
||||
functions --erase __fish_git_add_revision_completion
|
||||
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
|
||||
@@ -260,10 +260,12 @@ function __fish_complete_ip
|
||||
case address
|
||||
# We're still _on_ the second word, which is the subcommand
|
||||
if not set -q cmd[3]
|
||||
printf '%s\t%s\n' add "Add new protocol address" \
|
||||
printf '%s\t%s\n' \
|
||||
add "Add new protocol address" \
|
||||
delete "Delete protocol address" \
|
||||
show "Look at protocol addresses" \
|
||||
flush "Flush protocol addresses"
|
||||
flush "Flush protocol addresses" \
|
||||
help "Display help"
|
||||
else
|
||||
switch $cmd[2]
|
||||
# Change and replace are undocumented (apart from mentions in the BNF)
|
||||
@@ -339,7 +341,8 @@ function __fish_complete_ip
|
||||
end
|
||||
case link
|
||||
if not set -q cmd[3]
|
||||
printf '%s\t%s\n' add "Add virtual link" \
|
||||
printf '%s\t%s\n' \
|
||||
add "Add virtual link" \
|
||||
delete "Delete virtual link" \
|
||||
set "Change device attributes" \
|
||||
show "Display device attributes" \
|
||||
@@ -430,18 +433,20 @@ function __fish_complete_ip
|
||||
end
|
||||
case show
|
||||
case help
|
||||
__fish_ip_types
|
||||
end
|
||||
end
|
||||
case neighbour
|
||||
if not set -q cmd[3]
|
||||
printf '%s\t%s\n' help "Show help" \
|
||||
printf '%s\t%s\n' \
|
||||
add "Add new neighbour entry" \
|
||||
delete "Delete neighbour entry" \
|
||||
change "Change neighbour entry" \
|
||||
replace "Add or change neighbour entry" \
|
||||
show "List neighbour entries" \
|
||||
flush "Flush neighbour entries" \
|
||||
get "Lookup neighbour entry"
|
||||
get "Lookup neighbour entry" \
|
||||
help "Display help"
|
||||
else
|
||||
switch $cmd[2]
|
||||
case add del delete change replace
|
||||
@@ -505,7 +510,8 @@ function __fish_complete_ip
|
||||
get "Get a single route" \
|
||||
save "Save routing table to stdout" \
|
||||
showdump "Show saved routing table from stdin" \
|
||||
restore "Restore routing table from stdin"
|
||||
restore "Restore routing table from stdin" \
|
||||
help "Display help"
|
||||
else
|
||||
# TODO: switch on $cmd[2] and complete subcommand specific arguments
|
||||
# for now just complete most useful arguments for the last token
|
||||
@@ -524,7 +530,8 @@ function __fish_complete_ip
|
||||
flush "Flush rules" \
|
||||
show "List rules" \
|
||||
save "Save rules to stdout" \
|
||||
restore "Restore rules from stdin"
|
||||
restore "Restore rules from stdin" \
|
||||
help "Display help"
|
||||
else
|
||||
# TODO: switch on $cmd[2] and complete subcommand specific arguments
|
||||
# for now just complete most useful arguments for the last token
|
||||
@@ -579,6 +586,27 @@ function __fish_complete_ip
|
||||
end
|
||||
end
|
||||
end
|
||||
case tuntap
|
||||
if not set -q cmd[3]
|
||||
printf '%s\t%s\n' \
|
||||
add "Add a new tun or tap device" \
|
||||
del "Delete a tun or tap device" \
|
||||
show "Show tun and tap devices" \
|
||||
help "Display help"
|
||||
else
|
||||
switch $cmd[-2]
|
||||
case dev
|
||||
__fish_ip_device
|
||||
case mode
|
||||
printf '%s\n' tun tap
|
||||
case user
|
||||
__fish_complete_users
|
||||
case group
|
||||
__fish_complete_groups
|
||||
case '*'
|
||||
printf '%s\n' dev mode user group one_queue pi vnet_hdr multi_queue name
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -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,4 +1,4 @@
|
||||
#Keybase 5.6.1
|
||||
# Keybase 6.4.0
|
||||
|
||||
function __fish_keybase_line_ends_with
|
||||
set -l line (commandline -pxc | string match -v -r '^-')
|
||||
@@ -9,123 +9,132 @@ function __fish_keybase_line_ends_with
|
||||
end
|
||||
end
|
||||
|
||||
#variables
|
||||
# variables
|
||||
set -l ends __fish_keybase_line_ends_with
|
||||
set -l seen __fish_seen_subcommand_from
|
||||
#L1
|
||||
set -l keybase account blocks bot chat config ctl currency decrypt deprovision device encrypt follow fs git h help id kvstore list-followers list-following log login logout oneshot paperkey passphrase pgp ping prove rekey selfprovision service sign signup sigs status team track unfollow untrack update verify version wallet whoami
|
||||
#L2
|
||||
set -l keybase_account contact-settings delete email h help lockdown recover-username upload-avatar
|
||||
set -l keybase_blocks h help list-users list-teams
|
||||
# 1
|
||||
set -l keybase account apicall audit base62 blocks bot btc ca chat config ctl currency db decrypt deprovision device dir dismiss dismiss-category dump-keyfamily dump-push-notifications encrypt fnmr follow fs git h help home id interesting-people kvstore list-followers list-following log login logout network-stats oneshot paperkey passphrase pgp ping pprof prove push rekey riit script selfprovision service sign signup sigs status team track unfollow unlock untrack upak update upload-avatar verify version wallet web-auth-token whoami wot
|
||||
# 2
|
||||
set -l keybase_account contact-settings delete email h help lockdown phonenumber recover-username reset-cancel upload-avatar
|
||||
set -l keybase_audit box h help
|
||||
set -l keybase_base62 decode encode h help
|
||||
set -l keybase_blocks h help list-teams list-users
|
||||
set -l keybase_bot h help signup token
|
||||
set -l keybase_chat add-bot-member add-to-channel api api-listen bot-member-settings clear-commands conv-info create-channel default-channels delete-channel delete-history download edit-bot-member featured-bots h help hide join-channel leave-channel list list-channels list-members list-unread ls lsur min-writer-role mute notification-settings read readd-member remove-bot-member rename-channel report retention-policy search search-bots search-regexp send upload
|
||||
set -l keybase_chat add-bot-member add-to-channel api api-listen archive archive-delete archive-list archive-pause archive-resume bot-member-settings clear-commands conv-info create-channel default-channels delete-channel delete-history download edit-bot-member emoji-add emoji-addalias emoji-list emoji-remove featured-bots forward-message h help hide join-channel leave-channel list list-channels list-members list-unread ls lsur mark-as-read min-writer-role mute notification-settings read readd-member remove-bot-member remove-from-channel rename-channel report retention-policy search search-bots search-regexp send upload
|
||||
set -l keybase_config get h help info set
|
||||
set -l keybase_ctl app-exit autostart h help init log-rotate redirector reload restart start stop wait watchdog watchdog2
|
||||
set -l keybase_ctl app-exit autostart h help init log-rotate redirector reload restart start stop wait wants-systemd watchdog watchdog2
|
||||
set -l keybase_currency add h help
|
||||
set -l keybase_db clean delete get h help keys-with-prefix nuke put
|
||||
set -l keybase_device add h help list remove
|
||||
set -l keybase_fs clear-conflicts cp debug finish-resolving-conflicts get-status h help history kill ln ls mkdir mv ps quota read recover reset rm set-debug-level stat sync uploads write
|
||||
set -l keybase_git create delete gc h help lfs-config list settings
|
||||
set -l keybase_fs archive cancel-uploads clear-conflicts cp debug finish-resolving-conflicts get-status h help history index-progress kill ln ls mkdir mv ps quota read recover reset reset-index rm search set-debug-level stat sync uploads write
|
||||
set -l keybase_git archive create delete gc h help lfs-config list settings
|
||||
set -l keybase_help advanced gpg keyring tor
|
||||
set -l keybase_kvstore api h help
|
||||
set -l keybase_log h help send
|
||||
set -l keybase_log h help profile send
|
||||
set -l keybase_passphrase change check h help recover remember set
|
||||
set -l keybase_pgp decrypt drop encrypt export gen h help import list pull pull-private purge push-private select sign update verify
|
||||
set -l keybase_pprof cpu h heap help trace
|
||||
set -l keybase_rekey h help paper status
|
||||
set -l keybase_sigs h help list revoke
|
||||
set -l keybase_team accept-invite add-member add-members-bulk api bot-settings create delete edit-member h help ignore-request leave list-members list-memberships list-requests remove-member rename request-access search settings show-tree
|
||||
set -l keybase_team accept-invite add-member add-members-bulk api bot-settings create delete edit-member ftl generate-invite-token generate-invitelink h help ignore-request leave list-members list-memberships list-requests profile-load remove-member rename request-access search settings show-tree
|
||||
set -l keybase_update check check-in-use notify
|
||||
set -l keybase_wallet accounts add-trustline api asset-search balances cancel cancel-request change-trustline-limit delete-trustline detail details export get-inflation get-started h help history import list lookup merge popular-assets reclaim rename request send send-path-payment set-currency set-inflation set-primary sign
|
||||
#L3
|
||||
set -l keybase_wallet accounts balances detail details export h help list
|
||||
set -l keybase_wot accept h help list reject vouch
|
||||
# 3
|
||||
set -l keybase_account_email add delete edit h help list send-verification-email set-primary set-visibility
|
||||
set -l keybase_account_phonenumber add delete edit h help list set-visibility verify
|
||||
set -l keybase_bot_token create delete h help list
|
||||
set -l keybase_fs_archive cancel check check dismiss h help start status
|
||||
set -l keybase_fs_debug deobfuscate dump h help obfuscate
|
||||
set -l keybase_fs_sync disable enable h help show
|
||||
#...
|
||||
|
||||
#global options
|
||||
complete -c keybase -f -n "$ends keybase" -l api-dump-unsafe
|
||||
complete -c keybase -f -n "$ends keybase" -l api-timeout
|
||||
complete -c keybase -f -n "$ends keybase" -l api-uri-path-prefix
|
||||
complete -c keybase -f -n "$ends keybase" -l app-start-mode
|
||||
complete -c keybase -f -n "$ends keybase" -l auto-fork
|
||||
complete -c keybase -f -n "$ends keybase" -l bg-identifier-disabled
|
||||
complete -c keybase -f -n "$ends keybase" -l chat-db
|
||||
complete -c keybase -f -n "$ends keybase" -l code-signing-kids
|
||||
complete -c keybase -f -n "$ends keybase" -l config-file -s c
|
||||
complete -c keybase -f -n "$ends keybase" -l db
|
||||
complete -c keybase -f -n "$ends keybase" -l debug -s d
|
||||
complete -c keybase -f -n "$ends keybase" -l debug-journeycard
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-bg-conv-loader
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-cert-pinning
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-merkle-auditor
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-search-indexer
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-team-auditor
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-team-box-auditor
|
||||
complete -c keybase -f -n "$ends keybase" -l display-raw-untrusted-output
|
||||
complete -c keybase -f -n "$ends keybase" -l ek-log-file
|
||||
complete -c keybase -f -n "$ends keybase" -l enable-bot-lite-mode
|
||||
complete -c keybase -f -n "$ends keybase" -l extra-net-logging
|
||||
complete -c keybase -f -n "$ends keybase" -l features
|
||||
complete -c keybase -f -n "$ends keybase" -l force-linux-keyring
|
||||
complete -c keybase -f -n "$ends keybase" -l generate-bash-completion
|
||||
complete -c keybase -f -n "$ends keybase" -l gpg
|
||||
complete -c keybase -f -n "$ends keybase" -l gpg-options
|
||||
complete -c keybase -f -n "$ends keybase" -l gpgdir
|
||||
complete -c keybase -f -n "$ends keybase" -l gui-config-file
|
||||
complete -c keybase -f -n "$ends keybase" -l help -s h
|
||||
complete -c keybase -f -n "$ends keybase" -l home -s H
|
||||
complete -c keybase -f -n "$ends keybase" -l leveldb-num-files
|
||||
complete -c keybase -f -n "$ends keybase" -l local-rpc-debug-unsafe
|
||||
complete -c keybase -f -n "$ends keybase" -l log-file
|
||||
complete -c keybase -f -n "$ends keybase" -l log-format
|
||||
complete -c keybase -f -n "$ends keybase" -l log-prefix
|
||||
complete -c keybase -f -n "$ends keybase" -l merkle-kids
|
||||
complete -c keybase -f -n "$ends keybase" -l no-auto-fork -s F
|
||||
complete -c keybase -f -n "$ends keybase" -l no-debug
|
||||
complete -c keybase -f -n "$ends keybase" -l paramproof-kit
|
||||
complete -c keybase -f -n "$ends keybase" -l pgpdir
|
||||
complete -c keybase -f -n "$ends keybase" -l pid-file
|
||||
complete -c keybase -f -n "$ends keybase" -l pinentry
|
||||
complete -c keybase -f -n "$ends keybase" -l proof-cache-size
|
||||
complete -c keybase -f -n "$ends keybase" -l prove-bypass
|
||||
complete -c keybase -f -n "$ends keybase" -l proxy
|
||||
complete -c keybase -f -n "$ends keybase" -l proxy-type
|
||||
complete -c keybase -f -n "$ends keybase" -l push-disabled
|
||||
complete -c keybase -f -n "$ends keybase" -l push-save-interval
|
||||
complete -c keybase -f -n "$ends keybase" -l push-server-uri
|
||||
complete -c keybase -f -n "$ends keybase" -l pvl-kit
|
||||
complete -c keybase -f -n "$ends keybase" -l read-deleted-sigchain
|
||||
complete -c keybase -f -n "$ends keybase" -l remember-passphrase
|
||||
complete -c keybase -f -n "$ends keybase" -l run-mode
|
||||
complete -c keybase -f -n "$ends keybase" -l scraper-timeout
|
||||
complete -c keybase -f -n "$ends keybase" -l secret-keyring
|
||||
complete -c keybase -f -n "$ends keybase" -l server -s s
|
||||
complete -c keybase -f -n "$ends keybase" -l session-file
|
||||
complete -c keybase -f -n "$ends keybase" -l slow-gregor-conn
|
||||
complete -c keybase -f -n "$ends keybase" -l socket-file
|
||||
complete -c keybase -f -n "$ends keybase" -l standalone
|
||||
complete -c keybase -f -n "$ends keybase" -l timers
|
||||
complete -c keybase -f -n "$ends keybase" -l tor-hidden-address
|
||||
complete -c keybase -f -n "$ends keybase" -l tor-mode
|
||||
complete -c keybase -f -n "$ends keybase" -l tor-proxy
|
||||
complete -c keybase -f -n "$ends keybase" -l updater-config-file
|
||||
complete -c keybase -f -n "$ends keybase" -l use-default-log-file
|
||||
complete -c keybase -f -n "$ends keybase" -l use-root-config-file
|
||||
complete -c keybase -f -n "$ends keybase" -l user-cache-size
|
||||
complete -c keybase -f -n "$ends keybase" -l vdebug
|
||||
complete -c keybase -f -n "$ends keybase" -l version -s v
|
||||
# global options
|
||||
complete -c keybase -f -n "$ends keybase" -l api-dump-unsafe -d "Dump API call internals (may leak secrets)"
|
||||
complete -c keybase -f -n "$ends keybase" -l api-timeout -d "Set the HTTP timeout for API calls to the keybase API server"
|
||||
complete -c keybase -f -n "$ends keybase" -l api-uri-path-prefix -d "Specify an alternate API URI path prefix"
|
||||
complete -c keybase -f -n "$ends keybase" -l app-start-mode -d "Specify 'service' to auto-start UI app, or anything else to disable"
|
||||
complete -c keybase -f -n "$ends keybase" -l auto-fork -d "Enable auto-fork of background service"
|
||||
complete -c keybase -f -n "$ends keybase" -l bg-identifier-disabled -d "Supply to disable the BG identifier loop"
|
||||
complete -c keybase -f -n "$ends keybase" -l chat-db -d "Specify an alternate local Chat DB location"
|
||||
complete -c keybase -f -n "$ends keybase" -l code-signing-kids -d "Set of code signing key IDs (colon-separated)"
|
||||
complete -c keybase -f -n "$ends keybase" -l config-file -s c -d "Specify an (alternate) master config file"
|
||||
complete -c keybase -f -n "$ends keybase" -l db -d "Specify an alternate local DB location"
|
||||
complete -c keybase -f -n "$ends keybase" -l debug -s d -d "Enable debugging mode"
|
||||
complete -c keybase -f -n "$ends keybase" -l debug-journeycard -d "Enable experimental journey cards"
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-bg-conv-loader -d "Disable background conversation loading"
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-cert-pinning -d "WARNING: Do not use unless necessary!"
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-merkle-auditor -d "Disable background probabilistic merkle audit"
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-search-indexer -d "Disable chat search background indexer"
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-team-auditor -d "Disable auditing of teams"
|
||||
complete -c keybase -f -n "$ends keybase" -l disable-team-box-auditor -d "Disable box auditing of teams"
|
||||
complete -c keybase -f -n "$ends keybase" -l display-raw-untrusted-output -d "Display output from users without escaping terminal codes"
|
||||
complete -c keybase -f -n "$ends keybase" -l ek-log-file -d "Specify a log file for the keybase ephemeral key log"
|
||||
complete -c keybase -f -n "$ends keybase" -l enable-bot-lite-mode -d "Enable bot lite mode. Disables non-critical background services"
|
||||
complete -c keybase -f -n "$ends keybase" -l extra-net-logging -d "Do additional debug logging during network requests"
|
||||
complete -c keybase -f -n "$ends keybase" -l features -d "Specify experimental feature flags"
|
||||
complete -c keybase -f -n "$ends keybase" -l force-linux-keyring -d "Require the use of the OS keyring"
|
||||
complete -c keybase -f -n "$ends keybase" -l generate-bash-completion -d ""
|
||||
complete -c keybase -f -n "$ends keybase" -l gpg -d "Path to GPG client (optional for exporting keys)"
|
||||
complete -c keybase -f -n "$ends keybase" -l gpg-options -d "Options to use when calling GPG"
|
||||
complete -c keybase -f -n "$ends keybase" -l gpgdir -d "Specify a PGP directory (default is ~/.gnupg)"
|
||||
complete -c keybase -f -n "$ends keybase" -l gui-config-file -d "Specify a path to the GUI config file"
|
||||
complete -c keybase -f -n "$ends keybase" -l help -s h -d "Show help"
|
||||
complete -c keybase -f -n "$ends keybase" -l home -s H -d "Specify an (alternate) home directory"
|
||||
complete -c keybase -f -n "$ends keybase" -l leveldb-num-files -d "Specify the max number of files LevelDB may open"
|
||||
complete -c keybase -f -n "$ends keybase" -l local-rpc-debug-unsafe -d "Use to debug local RPC (may leak secrets)"
|
||||
complete -c keybase -f -n "$ends keybase" -l log-file -d "Specify a log file for the keybase service"
|
||||
complete -c keybase -f -n "$ends keybase" -l log-format -d "Log format (default, plain, file, fancy)"
|
||||
complete -c keybase -f -n "$ends keybase" -l log-prefix -d "Specify a prefix for a unique log file name"
|
||||
complete -c keybase -f -n "$ends keybase" -l merkle-kids -d "Set of admissible Merkle Tree fingerprints (colon-separated)"
|
||||
complete -c keybase -f -n "$ends keybase" -l no-auto-fork -s F -d "Disable auto-fork of background service"
|
||||
complete -c keybase -f -n "$ends keybase" -l no-debug -d "Suppress debugging mode; takes precedence over --debug"
|
||||
complete -c keybase -f -n "$ends keybase" -l paramproof-kit -d "Specify an alternate local parameterized proof kit file location"
|
||||
complete -c keybase -f -n "$ends keybase" -l pgpdir -d "Specify a PGP directory (default is ~/.gnupg)"
|
||||
complete -c keybase -f -n "$ends keybase" -l pid-file -d "Location of the keybased pid-file (to ensure only one running daemon)"
|
||||
complete -c keybase -f -n "$ends keybase" -l pinentry -d "Specify a path to find a pinentry program"
|
||||
complete -c keybase -f -n "$ends keybase" -l proof-cache-size -d "Number of proof entries to cache"
|
||||
complete -c keybase -f -n "$ends keybase" -l prove-bypass -d "Prove even disabled proof services"
|
||||
complete -c keybase -f -n "$ends keybase" -l proxy -d "Specify a proxy to ship all Web requests over"
|
||||
complete -c keybase -f -n "$ends keybase" -l proxy-type -d "Set the proxy type; One of: socks,http_connect"
|
||||
complete -c keybase -f -n "$ends keybase" -l push-disabled -d "Disable push server connection (which is on by default)"
|
||||
complete -c keybase -f -n "$ends keybase" -l push-save-interval -d "Set the interval between saves of the push cache (in seconds)"
|
||||
complete -c keybase -f -n "$ends keybase" -l push-server-uri -d "Specify a URI for contacting the Keybase push server"
|
||||
complete -c keybase -f -n "$ends keybase" -l pvl-kit -d "Specify an alternate local PVL kit file location"
|
||||
complete -c keybase -f -n "$ends keybase" -l read-deleted-sigchain -d "Allow admins to read deleted sigchains for debugging"
|
||||
complete -c keybase -f -n "$ends keybase" -l remember-passphrase -d "Remember keybase passphrase"
|
||||
complete -c keybase -f -n "$ends keybase" -l run-mode -d "Run mode (devel, staging, prod)"
|
||||
complete -c keybase -f -n "$ends keybase" -l scraper-timeout -d "Set the HTTP timeout for external proof scrapers"
|
||||
complete -c keybase -f -n "$ends keybase" -l secret-keyring -d "Location of the Keybase secret-keyring (P3SKB-encoded)"
|
||||
complete -c keybase -f -n "$ends keybase" -l server -s s -d "Specify server API"
|
||||
complete -c keybase -f -n "$ends keybase" -l session-file -d "Specify an alternate session data file"
|
||||
complete -c keybase -f -n "$ends keybase" -l slow-gregor-conn -d "Slow responses from gregor for testing"
|
||||
complete -c keybase -f -n "$ends keybase" -l socket-file -d "Location of the keybased socket-file"
|
||||
complete -c keybase -f -n "$ends keybase" -l standalone -d "Use the client without any daemon support"
|
||||
complete -c keybase -f -n "$ends keybase" -l timers -d "Specify 'a' for API; 'r' for RPCs; and 'x' for eXternal API calls"
|
||||
complete -c keybase -f -n "$ends keybase" -l tor-hidden-address -d "Set TOR address of keybase server"
|
||||
complete -c keybase -f -n "$ends keybase" -l tor-mode -d "Set TOR mode to be 'leaky', 'none', or 'strict'"
|
||||
complete -c keybase -f -n "$ends keybase" -l tor-proxy -d "Set TOR proxy; when Tor mode is on; defaults to localhost:9050"
|
||||
complete -c keybase -f -n "$ends keybase" -l updater-config-file -d "Specify a path to the updater config file"
|
||||
complete -c keybase -f -n "$ends keybase" -l use-default-log-file -d "Log to the default log file in $XDG_CACHE_HOME, or ~/.cache if unset"
|
||||
complete -c keybase -f -n "$ends keybase" -l use-root-config-file -d "Use the default root config on Linux only"
|
||||
complete -c keybase -f -n "$ends keybase" -l user-cache-size -d "Number of User entries to cache"
|
||||
complete -c keybase -f -n "$ends keybase" -l vdebug -d "Verbose debugging; takes a comma-joined list of levels and tags"
|
||||
complete -c keybase -f -n "$ends keybase" -l version -s v -d "Print the version"
|
||||
|
||||
#commands
|
||||
#L1
|
||||
# commands
|
||||
# 1
|
||||
complete -c keybase -f -n "not $ends keybase"
|
||||
complete -c keybase -f -n "$ends keybase" -a "$keybase"
|
||||
#L2
|
||||
# 2
|
||||
complete -c keybase -f -n "$ends keybase account" -a "$keybase_account"
|
||||
complete -c keybase -f -n "$ends keybase audit" -a "$keybase_audit"
|
||||
complete -c keybase -f -n "$ends keybase base62" -a "$keybase_base62"
|
||||
complete -c keybase -f -n "$ends keybase blocks" -a "$keybase_blocks"
|
||||
complete -c keybase -f -n "$ends keybase bot" -a "$keybase_bot"
|
||||
complete -c keybase -f -n "$ends keybase chat" -a "$keybase_chat"
|
||||
complete -c keybase -f -n "$ends keybase config" -a "$keybase_config"
|
||||
complete -c keybase -f -n "$ends keybase ctl" -a "$keybase_ctl"
|
||||
complete -c keybase -f -n "$ends keybase currency" -a "$keybase_currency"
|
||||
complete -c keybase -f -n "$ends keybase db" -a "$keybase_db"
|
||||
complete -c keybase -f -n "$ends keybase device" -a "$keybase_device"
|
||||
complete -c keybase -f -n "$ends keybase fs" -a "$keybase_fs"
|
||||
complete -c keybase -f -n "$ends keybase git" -a "$keybase_git"
|
||||
@@ -135,19 +144,22 @@ complete -c keybase -f -n "$ends keybase kvstore" -a "$keybase_kvstore"
|
||||
complete -c keybase -f -n "$ends keybase log" -a "$keybase_log"
|
||||
complete -c keybase -f -n "$ends keybase passphrase" -a "$keybase_passphrase"
|
||||
complete -c keybase -f -n "$ends keybase pgp" -a "$keybase_pgp"
|
||||
complete -c keybase -f -n "$ends keybase pprof" -a "$keybase_pprof"
|
||||
complete -c keybase -f -n "$ends keybase rekey" -a "$keybase_rekey"
|
||||
complete -c keybase -f -n "$ends keybase sigs" -a "$keybase_sigs"
|
||||
complete -c keybase -f -n "$ends keybase team" -a "$keybase_team"
|
||||
complete -c keybase -f -n "$ends keybase update" -a "$keybase_update"
|
||||
complete -c keybase -f -n "$ends keybase wallet" -a "$keybase_wallet"
|
||||
#...
|
||||
#L3
|
||||
complete -c keybase -f -n "$ends keybase wot" -a "$keybase_wot"
|
||||
# 3
|
||||
complete -c keybase -f -n "$ends keybase account email" -a "$keybase_account_email"
|
||||
complete -c keybase -f -n "$ends keybase account phonenumber" -a "$keybase_account_phonenumber"
|
||||
complete -c keybase -f -n "$ends keybase bot token" -a "$keybase_bot_token"
|
||||
complete -c keybase -f -n "$ends keybase fs archive" -a "$keybase_fs_archive"
|
||||
complete -c keybase -f -n "$ends keybase fs debug" -a "$keybase_fs_debug"
|
||||
complete -c keybase -f -n "$ends keybase fs sync" -a "$keybase_fs_sync"
|
||||
#...
|
||||
|
||||
#command options
|
||||
# command options
|
||||
complete -c keybase -f -n "$ends keybase account upload-avatar" -l skip-chat-message -s s
|
||||
complete -c keybase -f -n "$ends keybase account upload-avatar" -l team
|
||||
#...
|
||||
# ...
|
||||
|
||||
@@ -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"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user