mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-23 21:31:14 -03:00
Compare commits
49 Commits
Integratio
...
publish-tr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
03cee61f77 | ||
|
|
db6a7d26cd | ||
|
|
6be03d7cc4 | ||
|
|
617a6edb13 | ||
|
|
31c85723e8 | ||
|
|
d22c905d9f | ||
|
|
216dc2d473 | ||
|
|
918e7abe6b | ||
|
|
c145ee6df3 | ||
|
|
62543b36a4 | ||
|
|
751aad5302 | ||
|
|
efabab492a | ||
|
|
c7cdbe60cd | ||
|
|
412149a5de | ||
|
|
abd23d2a1b | ||
|
|
b774c54a6f | ||
|
|
e4b797405b | ||
|
|
81a89a5dec | ||
|
|
0da12a6b55 | ||
|
|
86ec8994e6 | ||
|
|
caf426ddb2 | ||
|
|
508ae410a6 | ||
|
|
993b977c9b | ||
|
|
a7f0138fc7 | ||
|
|
ab3c932903 | ||
|
|
ae0fdadcff | ||
|
|
e3974989d8 | ||
|
|
080b1e0e4f | ||
|
|
a5db91dd85 | ||
|
|
b62f54631b | ||
|
|
d835c5252a | ||
|
|
a53db72564 | ||
|
|
61b0368dac | ||
|
|
568b4a22f9 | ||
|
|
8abba8a089 | ||
|
|
b3b789cd68 | ||
|
|
425a166111 | ||
|
|
1dcc290e29 | ||
|
|
863204dbfa | ||
|
|
4b21e7c9c7 | ||
|
|
df5230ff4a | ||
|
|
7cd0943056 | ||
|
|
6f0532460a | ||
|
|
29a35a7951 | ||
|
|
dd0d45f88f | ||
|
|
0ff0de7efe | ||
|
|
092ef99551 | ||
|
|
97ae05b69d | ||
|
|
3d8eca178e |
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -163,7 +163,7 @@ jobs:
|
||||
# --break-system-packages because homebrew has now declared itself "externally managed".
|
||||
# this is CI so we don't actually care.
|
||||
sudo pip3 install --break-system-packages pexpect
|
||||
brew install tmux
|
||||
brew install gettext tmux
|
||||
- name: cmake
|
||||
run: |
|
||||
mkdir build && cd build
|
||||
|
||||
4
.github/workflows/release.yml
vendored
4
.github/workflows/release.yml
vendored
@@ -80,7 +80,7 @@ jobs:
|
||||
with:
|
||||
targets: x86_64-unknown-linux-musl,aarch64-unknown-linux-musl
|
||||
- name: Install dependencies
|
||||
run: sudo apt install crossbuild-essential-arm64 musl-tools python3-sphinx
|
||||
run: sudo apt install crossbuild-essential-arm64 gettext musl-tools python3-sphinx
|
||||
- name: Build statically-linked executables
|
||||
run: |
|
||||
set -x
|
||||
@@ -150,6 +150,8 @@ jobs:
|
||||
uses: ./.github/actions/rust-toolchain@stable
|
||||
with:
|
||||
targets: aarch64-apple-darwin
|
||||
- name: Install dependencies
|
||||
run: brew install gettext
|
||||
- name: Build and codesign
|
||||
run: |
|
||||
die() { echo >&2 "$*"; exit 1; }
|
||||
|
||||
56
.github/workflows/update-event-feeds.yml
vendored
Normal file
56
.github/workflows/update-event-feeds.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
on:
|
||||
pull_request_target:
|
||||
types: [opened, synchronize]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
pr_number:
|
||||
description: Pull request number
|
||||
required: true
|
||||
type: number
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
jobs:
|
||||
update-event-feeds:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt install python3-git python3-polib
|
||||
sudo pip3 install --break-system-packages feedgen==1.0.0
|
||||
- name: Update event feeds
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -x
|
||||
if [ "${{ github.event_name }}" = pull_request ]; then
|
||||
pr_number=${{ github.event.pull_request.number }}
|
||||
else
|
||||
pr_number=${{ inputs.pr_number }}
|
||||
fi
|
||||
# E.g. https://github.com/fish-shell/fish-shell
|
||||
repo_url=${{ github.server_url }}/${{ github.repository }}
|
||||
workflow_sha=${{ github.workflow_sha }}
|
||||
run_id=${{ github.run_id }}
|
||||
events_ref=refs/fish-shell-events
|
||||
git clone "$repo_url" --revision="$events_ref" worktree --depth=1
|
||||
cd worktree
|
||||
git fetch origin "$workflow_sha" --depth=1
|
||||
set -o pipefail
|
||||
git show "$workflow_sha":build_tools/event-feeds.py |
|
||||
python - "$pr_number"
|
||||
git add .
|
||||
if git diff --cached --exit-code; then
|
||||
exit
|
||||
fi
|
||||
git config user.name fish-shell-bot
|
||||
git config user.email fish-shell-bot
|
||||
git commit -m "update via github run ID $run_id"
|
||||
cat >>.git/config <<'EOF'
|
||||
[credential]
|
||||
username = fish-shell-bot
|
||||
helper = !sh -c 'echo "password=$GITHUB_TOKEN"'
|
||||
EOF
|
||||
# Might fail due to a race; that's usually fine to ignore...
|
||||
git push origin HEAD:"$events_ref" ||:
|
||||
@@ -1,3 +1,23 @@
|
||||
fish ?.?.? (released ???)
|
||||
=========================
|
||||
|
||||
fish 4.1.1 (released ???)
|
||||
=========================
|
||||
|
||||
This release fixes the following regressions identified in 4.1.0:
|
||||
|
||||
- Many of our new Chinese translations were more confusing than helpful; they have been fixed or removed (:issue:`11833`).
|
||||
|
||||
Note that you can work around this type of issue by configuring fish's :doc:`message localization <cmds/_>`:
|
||||
if your environment contains something like ``LANG=zh_CN.UTF-8``,
|
||||
you can use ``set -g LC_MESSAGES en`` to use English messages inside fish.
|
||||
This will not affect fish's child processes unless ``LC_MESSAGES`` was already exported.
|
||||
|
||||
- Some :doc:`fish_config <cmds/fish_config>` subcommands for showing prompts and themes had been broken in standalone Linux builds (those using the ``embed-data`` cargo feature), which has been fixed (:issue:`11832`).
|
||||
- On Windows Terminal, we observed an issue where fish would fail to read the terminal's response to our new startup queries, causing noticeable lags and a misleading error message. A workaround has been added (:issue:`11841`).
|
||||
- A WezTerm `issue breaking shifted key input <https://github.com/wezterm/wezterm/issues/6087>`__ has resurfaced on some versions of WezTerm; our workaround has been extended to cover all versions for now (:issue:`11204`).
|
||||
- Fixed a crash in :doc:`the web-based configuration tool <cmds/fish_config>` when using the new underline styles (:issue:`11840`).
|
||||
|
||||
fish 4.1.0 (released September 27, 2025)
|
||||
========================================
|
||||
|
||||
@@ -30,7 +50,7 @@ Deprecations and removed features
|
||||
- The ``--install`` option when fish is built as self-installing is removed, see :ref:`below <changelog-4.1-embedded>`.
|
||||
- ``set_color ff0000`` now outputs 24-bit RGB true-color even if :envvar:`COLORTERM` is unset.
|
||||
One can override this by setting :envvar:`fish_term24bit` to 0 (:issue:`11372`).
|
||||
- fish now requires the terminal to respond to queries for the :ref:`primary device attribute <term-compat-primary-da>`.
|
||||
- fish now requires the terminal to respond to queries for the :ref:`Primary Device Attribute <term-compat-primary-da>`.
|
||||
For now, this can be reversed via a :ref:`feature flag <featureflags>`,
|
||||
by running (once) ``set -Ua fish_features no-query-term`` and restarting fish.
|
||||
- Users of GNU screen may experience :ref:`minor glitches <term-compat-dcs-gnu-screen>` when starting fish.
|
||||
@@ -83,9 +103,6 @@ Improved terminal support
|
||||
- Support for double, curly, dotted and dashed underlines, for use in ``fish_color_*`` variables and the :doc:`set_color builtin <cmds/set_color>` (:issue:`10957`).
|
||||
- Underlines can now be colored independent of text (:issue:`7619`).
|
||||
- New documentation page :doc:`Terminal Compatibility <terminal-compatibility>` (also accessible via ``man fish-terminal-compatibility``) lists the terminal control sequences used by fish.
|
||||
- fish now requires the terminal to respond to queries for the :ref:`primary device attribute <term-compat-primary-da>`.
|
||||
For now, this can be reversed via a :ref:`feature flag <featureflags>`,
|
||||
by running (once) ``set -Ua fish_features no-query-term``.
|
||||
|
||||
Other improvements
|
||||
------------------
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -105,7 +105,7 @@ checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be"
|
||||
|
||||
[[package]]
|
||||
name = "fish"
|
||||
version = "4.1.0"
|
||||
version = "4.1.0-snapshot"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"cc",
|
||||
|
||||
@@ -64,7 +64,7 @@ debug = true
|
||||
|
||||
[package]
|
||||
name = "fish"
|
||||
version = "4.1.0"
|
||||
version = "4.1.0-snapshot"
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
default-run = "fish"
|
||||
|
||||
@@ -180,7 +180,7 @@ To install fish with embedded files, just use ``cargo``, like::
|
||||
cargo install --git https://github.com/fish-shell/fish-shell --tag "$(curl -s https://api.github.com/repos/fish-shell/fish-shell/releases/latest | jq -r .tag_name)" # to build the latest release
|
||||
cargo install --git https://github.com/fish-shell/fish-shell # to build the latest development snapshot
|
||||
|
||||
This will place the binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
|
||||
This will place the standalone binaries in ``~/.cargo/bin/``, but you can place them wherever you want.
|
||||
|
||||
This build won't have the HTML docs (``help`` will open the online version).
|
||||
It will try to build the man pages with sphinx-build. If that is not available and you would like to include man pages, you need to install it and retrigger the build script, e.g. by setting FISH_BUILD_DOCS=1::
|
||||
|
||||
49
build.rs
49
build.rs
@@ -3,7 +3,6 @@
|
||||
use fish_build_helper::{fish_build_dir, workspace_root};
|
||||
use rsconf::Target;
|
||||
use std::env;
|
||||
use std::error::Error;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
fn canonicalize<P: AsRef<Path>>(path: P) -> PathBuf {
|
||||
@@ -81,53 +80,44 @@ fn detect_cfgs(target: &mut Target) {
|
||||
for (name, handler) in [
|
||||
// Ignore the first entry, it just sets up the type inference. Model new entries after the
|
||||
// second line.
|
||||
(
|
||||
"",
|
||||
&(|_: &Target| Ok(false)) as &dyn Fn(&Target) -> Result<bool, Box<dyn Error>>,
|
||||
),
|
||||
("", &(|_: &Target| false) as &dyn Fn(&Target) -> bool),
|
||||
("apple", &detect_apple),
|
||||
("bsd", &detect_bsd),
|
||||
("cygwin", &detect_cygwin),
|
||||
("small_main_stack", &has_small_stack),
|
||||
// See if libc supports the thread-safe localeconv_l(3) alternative to localeconv(3).
|
||||
("localeconv_l", &|target| {
|
||||
Ok(target.has_symbol("localeconv_l"))
|
||||
target.has_symbol("localeconv_l")
|
||||
}),
|
||||
("FISH_USE_POSIX_SPAWN", &|target| {
|
||||
Ok(target.has_header("spawn.h"))
|
||||
target.has_header("spawn.h")
|
||||
}),
|
||||
("HAVE_PIPE2", &|target| {
|
||||
Ok(target.has_symbol("pipe2"))
|
||||
target.has_symbol("pipe2")
|
||||
}),
|
||||
("HAVE_EVENTFD", &|target| {
|
||||
// FIXME: NetBSD 10 has eventfd, but the libc crate does not expose it.
|
||||
if cfg!(target_os = "netbsd") {
|
||||
Ok(false)
|
||||
false
|
||||
} else {
|
||||
Ok(target.has_header("sys/eventfd.h"))
|
||||
target.has_header("sys/eventfd.h")
|
||||
}
|
||||
}),
|
||||
("HAVE_WAITSTATUS_SIGNAL_RET", &|target| {
|
||||
Ok(target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"]))
|
||||
target.r#if("WEXITSTATUS(0x007f) == 0x7f", &["sys/wait.h"])
|
||||
}),
|
||||
] {
|
||||
match handler(target) {
|
||||
Err(e) => {
|
||||
rsconf::warn!("{}: {}", name, e);
|
||||
rsconf::declare_cfg(name, false);
|
||||
},
|
||||
Ok(enabled) => rsconf::declare_cfg(name, enabled),
|
||||
}
|
||||
rsconf::declare_cfg(name, handler(target))
|
||||
}
|
||||
}
|
||||
|
||||
fn detect_apple(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
Ok(cfg!(any(target_os = "ios", target_os = "macos")))
|
||||
fn detect_apple(_: &Target) -> bool {
|
||||
cfg!(any(target_os = "ios", target_os = "macos"))
|
||||
}
|
||||
|
||||
fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
fn detect_cygwin(_: &Target) -> bool {
|
||||
// Cygwin target is usually cross-compiled.
|
||||
Ok(std::env::var("CARGO_CFG_TARGET_OS").unwrap() == "cygwin")
|
||||
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
|
||||
@@ -136,13 +126,14 @@ fn detect_cygwin(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
/// Rust offers fine-grained conditional compilation per-os for the popular operating systems, but
|
||||
/// doesn't necessarily include less-popular forks nor does it group them into families more
|
||||
/// specific than "windows" vs "unix" so we can conditionally compile code for BSD systems.
|
||||
fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
fn detect_bsd(_: &Target) -> bool {
|
||||
// Instead of using `uname`, we can inspect the TARGET env variable set by Cargo. This lets us
|
||||
// support cross-compilation scenarios.
|
||||
let mut target = std::env::var("TARGET").unwrap();
|
||||
if !target.chars().all(|c| c.is_ascii_lowercase()) {
|
||||
target = target.to_ascii_lowercase();
|
||||
}
|
||||
#[allow(clippy::let_and_return)] // for old clippy
|
||||
let is_bsd = target.ends_with("bsd") || target.ends_with("dragonfly");
|
||||
#[cfg(any(
|
||||
target_os = "dragonfly",
|
||||
@@ -151,7 +142,7 @@ fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
target_os = "openbsd",
|
||||
))]
|
||||
assert!(is_bsd, "Target incorrectly detected as not BSD!");
|
||||
Ok(is_bsd)
|
||||
is_bsd
|
||||
}
|
||||
|
||||
/// Rust sets the stack size of newly created threads to a sane value, but is at at the mercy of the
|
||||
@@ -160,13 +151,13 @@ fn detect_bsd(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
///
|
||||
/// 0.5 MiB is small enough that we'd have to drastically reduce MAX_STACK_DEPTH to less than 10, so
|
||||
/// we instead use a workaround to increase the main thread size.
|
||||
fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
fn has_small_stack(_: &Target) -> bool {
|
||||
#[cfg(not(any(target_os = "ios", target_os = "macos", target_os = "netbsd")))]
|
||||
return Ok(false);
|
||||
return false;
|
||||
|
||||
// NetBSD 10 also needs this but can't find pthread_get_stacksize_np.
|
||||
#[cfg(target_os = "netbsd")]
|
||||
return Ok(true);
|
||||
return true;
|
||||
|
||||
#[cfg(any(target_os = "ios", target_os = "macos"))]
|
||||
{
|
||||
@@ -182,8 +173,8 @@ fn has_small_stack(_: &Target) -> Result<bool, Box<dyn Error>> {
|
||||
let stack_size = unsafe { pthread_get_stacksize_np(pthread_self()) };
|
||||
const TWO_MIB: usize = 2 * 1024 * 1024 - 1;
|
||||
match stack_size {
|
||||
0..=TWO_MIB => Ok(true),
|
||||
_ => Ok(false),
|
||||
0..=TWO_MIB => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
155
build_tools/event-feeds.py
Normal file
155
build_tools/event-feeds.py
Normal file
@@ -0,0 +1,155 @@
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Tuple
|
||||
import dateutil.tz
|
||||
import json
|
||||
import re
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
# TODO maybe use https://github.com/getpelican/feedgenerator instead?
|
||||
from feedgen.feed import FeedGenerator
|
||||
import git
|
||||
import polib
|
||||
|
||||
|
||||
def message_dictionary(repo, ref, file: Path):
|
||||
po_contents = repo.git().show(f"{ref}:{file}")
|
||||
messages = polib.pofile(po_contents)
|
||||
return {e.msgid: e.msgstr for e in messages}
|
||||
|
||||
|
||||
def write_feed(
|
||||
feed_path: Path,
|
||||
base_ref_oid: str,
|
||||
title: str,
|
||||
subtitle: str,
|
||||
this_pr: Tuple[str, str] | None,
|
||||
):
|
||||
fg = FeedGenerator()
|
||||
tree_url = (
|
||||
"https://raw.githubusercontent.com/fish-shell/fish-shell/fish-shell-events"
|
||||
)
|
||||
feed_url = f"{tree_url}/{feed_path}"
|
||||
fg.id(feed_url)
|
||||
fg.title(title)
|
||||
fg.subtitle(subtitle)
|
||||
fg.link(href=feed_url, rel="self")
|
||||
generator_url = f"https://github.com/fish-shell/fish-shell/blob/{base_ref_oid}/.github/workflows/update-event-feeds.yml"
|
||||
fg.link(href=generator_url, rel="alternate")
|
||||
|
||||
entries = {}
|
||||
if feed_path.exists():
|
||||
tree = ET.parse(feed_path)
|
||||
root = tree.getroot()
|
||||
xmlns = "{http://www.w3.org/2005/Atom}"
|
||||
for child in root.findall(f"{xmlns}entry"):
|
||||
pr_url = child.find(f"{xmlns}id").text
|
||||
pr_title = child.find(f"{xmlns}title").text
|
||||
updated = child.find(f"{xmlns}updated").text
|
||||
updated = datetime.fromisoformat(updated)
|
||||
entries[pr_url] = (pr_title, updated)
|
||||
if this_pr is not None:
|
||||
(this_pr_title, this_pr_url) = this_pr
|
||||
if this_pr_url not in entries:
|
||||
entries[this_pr_url] = (this_pr_title, datetime.now(dateutil.tz.tzutc()))
|
||||
for pr_url, (pr_title, updated) in entries.items():
|
||||
fe = fg.add_entry()
|
||||
fe.id(pr_url)
|
||||
fe.title(pr_title)
|
||||
fe.updated(updated)
|
||||
fe.link(href=pr_url)
|
||||
atomfeed = fg.atom_str(pretty=True).decode()
|
||||
feed_path.write_text(atomfeed)
|
||||
|
||||
|
||||
def pull_request_data(pr_number: str):
|
||||
data = json.loads(
|
||||
subprocess.check_output(
|
||||
(
|
||||
"gh",
|
||||
"pr",
|
||||
"view",
|
||||
"--json",
|
||||
"baseRefOid,headRefOid,title,url",
|
||||
str(pr_number),
|
||||
),
|
||||
text=True,
|
||||
)
|
||||
)
|
||||
base_ref_oid = data["baseRefOid"]
|
||||
head_ref_oid = data["headRefOid"]
|
||||
this_pr_title = data["title"]
|
||||
this_pr_url = data["url"]
|
||||
return (base_ref_oid, head_ref_oid, this_pr_title, this_pr_url)
|
||||
|
||||
|
||||
def main():
|
||||
pr_number = sys.argv[1]
|
||||
|
||||
(base_ref_oid, head_ref_oid, this_pr_title, this_pr_url) = pull_request_data(
|
||||
pr_number
|
||||
)
|
||||
|
||||
repo = git.Repo()
|
||||
repo.git().execute(("git", "fetch", "origin", base_ref_oid, head_ref_oid))
|
||||
po_files = (
|
||||
Path(file)
|
||||
for file in repo.git()
|
||||
.execute(("git", "ls-tree", "--name-only", base_ref_oid, ":/po/"))
|
||||
.splitlines()
|
||||
)
|
||||
changed_files = {
|
||||
Path(file)
|
||||
for file in subprocess.check_output(
|
||||
("git", "diff", "--name-only", base_ref_oid, head_ref_oid), text=True
|
||||
).splitlines()
|
||||
if re.match(r"^po/\w+\.po$", file)
|
||||
}
|
||||
Path("po").mkdir(exist_ok=True)
|
||||
for po_file in po_files:
|
||||
file_without_extension = str(po_file).removesuffix(".po")
|
||||
ll_CC = os.path.basename(file_without_extension)
|
||||
feed_additions_path = Path(f"{file_without_extension}-additions.atom")
|
||||
feed_removals_path = Path(f"{file_without_extension}-removals.atom")
|
||||
|
||||
def title(verb: str):
|
||||
return f"fish-shell PRs {verb} {ll_CC} translations"
|
||||
|
||||
def write_additions(this_pr):
|
||||
subtitle = "PRs that add new translations"
|
||||
write_feed(
|
||||
feed_additions_path, base_ref_oid, title("adding"), subtitle, this_pr
|
||||
)
|
||||
|
||||
def write_removals(this_pr):
|
||||
subtitle = "PRs that remove translations, often due to a change in the messages source"
|
||||
write_feed(
|
||||
feed_removals_path, base_ref_oid, title("removing"), subtitle, this_pr
|
||||
)
|
||||
|
||||
if not feed_additions_path.exists():
|
||||
write_additions(None)
|
||||
if not feed_removals_path.exists():
|
||||
write_removals(None)
|
||||
|
||||
if po_file not in changed_files:
|
||||
continue
|
||||
old = message_dictionary(repo, base_ref_oid, po_file)
|
||||
new = message_dictionary(repo, head_ref_oid, po_file)
|
||||
if any(
|
||||
new_msgstr != old.get(new_msgid) and new_msgstr != ""
|
||||
for (new_msgid, new_msgstr) in new.items()
|
||||
):
|
||||
write_additions((this_pr_title, this_pr_url))
|
||||
elif any(
|
||||
old_msgstr != "" and new.get(old_msgid, "") == ""
|
||||
for (old_msgid, old_msgstr) in old.items()
|
||||
):
|
||||
write_removals((this_pr_title, this_pr_url))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -19,7 +19,7 @@ begin
|
||||
echo ""
|
||||
end
|
||||
|
||||
set -g workspace_root (status dirname)/..
|
||||
set -g workspace_root (path resolve (status dirname)/..)
|
||||
|
||||
set -l rust_extraction_file
|
||||
if set -l --query _flag_use_existing_template
|
||||
@@ -27,10 +27,19 @@ begin
|
||||
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 --features=gettext-extract
|
||||
FISH_GETTEXT_EXTRACTION_FILE=$rust_extraction_file cargo check --no-default-features --features=gettext-extract
|
||||
or exit 1
|
||||
end
|
||||
|
||||
function mark_section
|
||||
set -l section_name $argv[1]
|
||||
echo 'msgid "fish-section-'$section_name'"'
|
||||
echo 'msgstr ""'
|
||||
echo ''
|
||||
end
|
||||
|
||||
mark_section tier1-from-rust
|
||||
|
||||
# Get rid of duplicates and sort.
|
||||
msguniq --no-wrap --strict --sort-output $rust_extraction_file
|
||||
or exit 1
|
||||
@@ -39,8 +48,9 @@ begin
|
||||
rm $rust_extraction_file
|
||||
end
|
||||
|
||||
function extract_fish_script_messages --argument-names regex
|
||||
|
||||
function extract_fish_script_messages_impl
|
||||
set -l regex $argv[1]
|
||||
set -e argv[1]
|
||||
# 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).
|
||||
@@ -59,24 +69,74 @@ begin
|
||||
# 5. Double quotes are escaped, such that they are not interpreted as the start or end of
|
||||
# a msgid.
|
||||
# 6. We transform the string into the format expected in a PO file.
|
||||
cat $share_dir/config.fish $share_dir/completions/*.fish $share_dir/functions/*.fish |
|
||||
cat $argv |
|
||||
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
|
||||
|
||||
function extract_fish_script_messages
|
||||
set -l tier $argv[1]
|
||||
set -e argv[1]
|
||||
if not set -q argv[1]
|
||||
return
|
||||
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) *\).*'
|
||||
mark_section "$tier-from-script-explicitly-added"
|
||||
extract_fish_script_messages_impl $explicit_regex $argv
|
||||
|
||||
# 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).*'
|
||||
mark_section "$tier-from-script-implicitly-added"
|
||||
extract_fish_script_messages_impl $implicit_regex $argv
|
||||
end
|
||||
|
||||
set -g share_dir $workspace_root/share
|
||||
|
||||
# This regex handles explicit requests to translate a message. These are more important to translate
|
||||
# than messages which should be implicitly translated.
|
||||
set -l explicit_regex '.*\( *_ (([\'"]).+?(?<!\\\\)\\2) *\).*'
|
||||
extract_fish_script_messages $explicit_regex
|
||||
set -l tier1 $share_dir/config.fish
|
||||
set -l tier2
|
||||
set -l tier3
|
||||
|
||||
# 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
|
||||
for file in $share_dir/completions/*.fish $share_dir/functions/*.fish
|
||||
# set -l tier (string match -r '^# localization: .*' <$file)
|
||||
set -l tier (string replace -rf -m1 \
|
||||
'^# localization: (.*)$' '$1' <$file)
|
||||
if set -q tier[1]
|
||||
switch "$tier"
|
||||
case tier1 tier2 tier3
|
||||
set -a $tier $file
|
||||
case 'skip*'
|
||||
case '*'
|
||||
echo >&2 "$file:1 unexpected localization tier: $tier"
|
||||
exit 1
|
||||
end
|
||||
continue
|
||||
end
|
||||
set -l dirname (path basename (path dirname $file))
|
||||
set -l command_name (path basename --no-extension $file)
|
||||
if test $dirname = functions &&
|
||||
string match -q -- 'fish_*' $command_name
|
||||
set -a tier1 $file
|
||||
continue
|
||||
end
|
||||
if test $dirname != completions
|
||||
echo >&2 "$file:1 missing localization tier for function file"
|
||||
exit 1
|
||||
end
|
||||
if test -e $workspace_root/doc_src/cmds/$command_name.rst
|
||||
set -a tier1 $file
|
||||
else
|
||||
set -a tier3 $file
|
||||
end
|
||||
end
|
||||
|
||||
extract_fish_script_messages tier1 $tier1
|
||||
extract_fish_script_messages tier2 $tier2
|
||||
extract_fish_script_messages tier3 $tier3
|
||||
end |
|
||||
# At this point, all extracted strings have been written to stdout,
|
||||
# starting with the ones taken from the Rust sources,
|
||||
|
||||
@@ -53,14 +53,14 @@ previous_minor_version=${previous_version%.*}
|
||||
)
|
||||
fi
|
||||
|
||||
printf %s "$(awk <"$workspace_root/CHANGELOG.rst" '
|
||||
printf '%s\n' "$(awk <"$workspace_root/CHANGELOG.rst" '
|
||||
NR <= 2 || /^\.\. ignore / { next }
|
||||
/^===/ { exit }
|
||||
{ print }
|
||||
' | sed '$d')" |
|
||||
sed -e '$s/^----*$//' # Remove spurious transitions at the end of the document.
|
||||
|
||||
if [ "$minor_version" != "$previous_minor_version" ]; then
|
||||
if [ "$minor_version" != "$previous_minor_version" ]; then {
|
||||
JoinEscaped() {
|
||||
sed 's/\S/\\&/g' |
|
||||
awk '
|
||||
@@ -79,7 +79,7 @@ previous_minor_version=${previous_version%.*}
|
||||
echo
|
||||
printf "Welcome back our returning committers: "
|
||||
JoinEscaped <"$relnotes_tmp/committers-returning"
|
||||
fi
|
||||
} fi
|
||||
echo
|
||||
echo "---"
|
||||
echo
|
||||
|
||||
@@ -136,7 +136,10 @@ rm -rf "$tmpdir"
|
||||
cd "$fish_site"
|
||||
make
|
||||
git add -u
|
||||
! git ls-files --others --exclude-standard | grep .
|
||||
git add docs
|
||||
if git ls-files --others --exclude-standard | grep .; then
|
||||
exit 1
|
||||
fi
|
||||
git commit --message="$(printf %s "\
|
||||
| Release $version (docs)
|
||||
|
|
||||
@@ -184,7 +187,10 @@ done
|
||||
cd "$fish_site"
|
||||
make new-release
|
||||
git add -u
|
||||
! git ls-files --others --exclude-standard | grep .
|
||||
git add docs
|
||||
if git ls-files --others --exclude-standard | grep .; then
|
||||
exit 1
|
||||
fi
|
||||
git commit --message="$(printf %s "\
|
||||
| Release $version (release list update)
|
||||
|
|
||||
@@ -195,7 +201,7 @@ done
|
||||
git push git@github.com:$repository_owner/fish-site HEAD:master
|
||||
)
|
||||
|
||||
if [ -n "$integration_branch" ]; then
|
||||
if [ -n "$integration_branch" ]; then {
|
||||
git push $remote "$version^{commit}":refs/heads/$integration_branch
|
||||
else
|
||||
changelog=$(cat - CHANGELOG.rst <<EOF
|
||||
@@ -207,21 +213,6 @@ EOF
|
||||
printf %s\\n "$changelog" >CHANGELOG.rst
|
||||
CommitVersion ${version}-snapshot "start new cycle"
|
||||
git push $remote HEAD:master
|
||||
fi
|
||||
|
||||
# TODO This can currently require a TTY for editing and password
|
||||
# prompts.
|
||||
if [ "$repository_owner" = fish-shell ]; then {
|
||||
mail=$(mktemp)
|
||||
cat >$mail <<EOF
|
||||
From: $(git var GIT_AUTHOR_IDENT | sed 's/ [0-9]* +[0-9]*$//')
|
||||
Subject: fish $version released
|
||||
|
||||
See https://github.com/fish-shell/fish-shell/releases/tag/$version
|
||||
EOF
|
||||
git send-email --suppress-cc=all --confirm=always $mail \
|
||||
--to="fish-users Mailing List <fish-users@lists.sourceforge.net>"
|
||||
rm $mail
|
||||
} fi
|
||||
|
||||
exit
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
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
|
||||
@@ -46,8 +45,8 @@ if test -z $argv[1]
|
||||
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
|
||||
set -l arg_dir_id (stat --format='%d:%i' -- (dirname $arg) 2>/dev/null)
|
||||
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 ""
|
||||
@@ -99,17 +98,54 @@ if set -l --query _flag_dry_run
|
||||
cp -r $po_dir/* $tmpdir
|
||||
end
|
||||
|
||||
# This is used to identify lines which should be set here via $header_lines.
|
||||
# Make sure that this prefix does not appear elsewhere in the file and only contains characters
|
||||
# without special meaning in a sed pattern.
|
||||
set -g header_prefix "# fish-note: "
|
||||
|
||||
function print_header -a po_file
|
||||
set -l ll_CC (basename $po_file .po)
|
||||
set -l header_lines \
|
||||
"To subscribe to proposed updates, point your feed reader at:" \
|
||||
https://raw.githubusercontent.com/fish-shell/fish-shell/fish-shell-events/po/$ll_CC-additions.atom \
|
||||
https://raw.githubusercontent.com/fish-shell/fish-shell/fish-shell-events/po/$ll_CC-removals.atom \
|
||||
"Translations are divided into sections, each starting with a fish-section-* pseudo-message." \
|
||||
"The first few sections are more important." \
|
||||
"Ignore the tier3 sections unless you have a lot of time."
|
||||
for line in $header_lines
|
||||
printf '%s%s\n' $header_prefix $line
|
||||
end
|
||||
end
|
||||
|
||||
function merge_po_files --argument-names template_file po_file
|
||||
msgmerge --no-wrap --update --no-fuzzy-matching --backup=none --quiet \
|
||||
$po_file $template_file
|
||||
or cleanup_exit
|
||||
set -l new_po_file (mktemp) # TODO Remove on failure.
|
||||
# Remove obsolete messages instead of keeping them as #~ entries.
|
||||
and msgattrib --no-wrap --no-obsolete -o $new_po_file $po_file
|
||||
or cleanup_exit
|
||||
|
||||
begin
|
||||
print_header $po_file
|
||||
# Paste PO file without old header lines.
|
||||
sed '/^'$header_prefix'/d' $new_po_file
|
||||
end >$po_file
|
||||
rm $new_po_file
|
||||
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
|
||||
merge_po_files $template_file $po_file
|
||||
else
|
||||
cp $template_file $po_file
|
||||
begin
|
||||
print_header $po_file
|
||||
cat $template_file
|
||||
end >$po_file
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
env,
|
||||
ffi::OsStr,
|
||||
path::{Path, PathBuf},
|
||||
process::Command,
|
||||
process::{Command, Stdio},
|
||||
};
|
||||
|
||||
fn main() {
|
||||
@@ -34,7 +34,11 @@ fn embed_localizations(cache_dir: &Path) {
|
||||
// for the respective language.
|
||||
let mut catalogs = phf_codegen::Map::new();
|
||||
|
||||
match Command::new("msgfmt").arg("-h").status() {
|
||||
match Command::new("msgfmt")
|
||||
.arg("-h")
|
||||
.stdout(Stdio::null())
|
||||
.status()
|
||||
{
|
||||
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
|
||||
rsconf::warn!(
|
||||
"Cannot find msgfmt to build gettext message catalogs. Localization will not work."
|
||||
@@ -97,6 +101,12 @@ fn embed_localizations(cache_dir: &Path) {
|
||||
.arg(&po_file_path)
|
||||
.output()
|
||||
.unwrap();
|
||||
if !output.status.success() {
|
||||
panic!(
|
||||
"msgfmt failed:\n{}",
|
||||
String::from_utf8(output.stderr).unwrap()
|
||||
);
|
||||
}
|
||||
let mo_data = output.stdout;
|
||||
|
||||
// Extract map from MO data.
|
||||
|
||||
@@ -72,7 +72,7 @@ Required Commands
|
||||
|
||||
``\e[0c``
|
||||
-
|
||||
- Request primary device attribute.
|
||||
- Request Primary Device Attribute.
|
||||
The terminal must respond with a CSI command that starts with the ``?`` parameter byte (so a sequence starting with ``\e[?``) and has ``c`` as final byte.
|
||||
|
||||
Failure to implement this will cause a brief pause at startup followed by a warning.
|
||||
|
||||
3871
po/pt_BR.po
3871
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
49685
po/zh_CN.po
49685
po/zh_CN.po
File diff suppressed because it is too large
Load Diff
@@ -1 +1,2 @@
|
||||
# localization: tier1
|
||||
complete ! --wraps not
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
# localization: tier1
|
||||
complete [ --wraps test
|
||||
|
||||
@@ -11,7 +11,7 @@ complete -c commandline -s t -l current-token -d "Select token under cursor"
|
||||
complete -c commandline -s b -l current-buffer -d "Select entire command line (default)"
|
||||
|
||||
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 f -l function -d "execute readline function"
|
||||
complete -c commandline -s x -l tokens-expanded -d "Print a list of expanded tokens"
|
||||
|
||||
complete -c commandline -s I -l input -d "Specify command to operate on"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(barely-used)
|
||||
|
||||
set --local CONDITION '! __fish_seen_argument --short r --long required-val --short o --long optional-val'
|
||||
|
||||
complete --command fish_opt --no-files
|
||||
|
||||
@@ -122,7 +122,7 @@ complete -c help -x -a exporting-variables -d "What set -x does"
|
||||
complete -c help -x -a functions -d "How to define functions"
|
||||
complete -c help -x -a home-directory-expansion -d "~ expansion"
|
||||
complete -c help -x -a index-range-expansion -d "var[x..y] slices"
|
||||
complete -c help -x -a input-output-redirection -d "< and > redirectoins"
|
||||
complete -c help -x -a input-output-redirection -d "< and > redirections"
|
||||
complete -c help -x -a lists -d "Variables with multiple elements"
|
||||
complete -c help -x -a loops-and-blocks -d "while, for and begin"
|
||||
complete -c help -x -a more-on-universal-variables
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
function N_ --description No-op
|
||||
# localization: skip(deprecated)
|
||||
function N_
|
||||
printf "%s" $argv
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# returns 0 only if any argument is on of the supplied arguments
|
||||
function __fish_any_arg_in
|
||||
set -l haystack $argv
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_anyeditor --description "Print a editor to use, or an error message"
|
||||
# localization: tier1
|
||||
function __fish_anyeditor
|
||||
set -l editor
|
||||
if set -q VISUAL
|
||||
echo $VISUAL | read -at editor
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_anypager --description "Print a pager to use"
|
||||
set -l pager
|
||||
# We prefer $PAGER if we have it
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_anypython
|
||||
# Try python3 first, because that's usually faster and generally nicer.
|
||||
# Do not consider the stub /usr/bin/python3 that comes installed on Darwin to be Python
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_append -d "Internal completion function for appending string to the commandline" --argument-names sep
|
||||
set -e argv[1]
|
||||
set -l str (commandline -tc | string replace -rf "(.*$sep)[^$sep]*" '$1' | string replace -r -- '--.*=' '')
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
if not type -q apropos
|
||||
function __fish_apropos
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_argcomplete_complete
|
||||
set -lx _ARGCOMPLETE 1
|
||||
set -lx _ARGCOMPLETE_IFS \n
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cache_put
|
||||
set -l cache_file $argv[1]
|
||||
touch $cache_file
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cache_sourced_completions
|
||||
# Allow a `--name=foo` option which ends up in the filename.
|
||||
argparse -s name= -- $argv
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cached --description "Cache the command output for a given amount of time"
|
||||
|
||||
argparse --min-args 1 --max-args 1 --stop-nonopt 't/max-age=!_validate_int --min 0' 'k/cache-key=' -- $argv
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# This is meant to be bound to something like ctrl-c
|
||||
function __fish_cancel_commandline
|
||||
commandline -f cancel-commandline
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_change_key_bindings --argument-names bindings
|
||||
set -g __fish_active_key_bindings $bindings
|
||||
# Allow the user to set the variable universally
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_cmd__complete_args -d 'Function to generate args'
|
||||
# localization: tier3
|
||||
function __fish_cmd__complete_args
|
||||
set -l current_token (commandline -tc)
|
||||
|
||||
switch $current_token
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# TODO: This function is deprecated. It was used in fish_clipboard_paste
|
||||
# which some users copied, so maybe leave it around for a few years.
|
||||
function __fish_commandline_is_singlequoted --description "Return 0 if the current token has an open single-quote"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_atool_archive_contents --description 'List archive contents'
|
||||
set -l cmd (commandline -cxp)
|
||||
set -e cmd[1]
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# localization: tier3
|
||||
#
|
||||
# Bittorrent commands
|
||||
|
||||
function __fish_complete_bittorrent
|
||||
complete -c $argv -l max_uploads -x --description "Maximum uploads at once"
|
||||
complete -c $argv -l keepalive_interval -x --description "Number of seconds between keepalives"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# Helper function for completions that need to enumerate block devices.
|
||||
function __fish_complete_blockdevice
|
||||
set -l cmd (commandline -ct)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This function only emits completions that might result from matches against $CDPATH. We rely on
|
||||
# the core file name completion logic to include all other possible matches.
|
||||
function __fish_complete_cd -d "Completions for the cd command"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This function is compatible with clang, clang++, and variations thereof, and is shared
|
||||
# by clang.fish and clang++.fish.
|
||||
# We dynamically query the head at `(commandline -x)[1]` to get the correct completions.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_command --description 'Complete using all available commands'
|
||||
set -l ctoken "$(commandline -ct)"
|
||||
switch $ctoken
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_convert_options --description 'Complete Convert options' --argument-names what
|
||||
switch $what
|
||||
case format Format
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# Find directories that complete $argv[1], output them as completions
|
||||
# with description $argv[2] if defined, otherwise use 'Directory'.
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_docutils -d "Completions for Docutils common options" -a cmd
|
||||
# localization: tier3
|
||||
function __fish_complete_docutils -a cmd
|
||||
complete -x -c $cmd -k -a "(__fish_complete_suffix .rst .txt)"
|
||||
|
||||
# General Docutils Options
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_freedesktop_icons -d 'List installed icon names according to `https://specifications.freedesktop.org/icon-theme-spec/0.13/`'
|
||||
# The latest `icon-theme-spec` as of 2024-08-10 is 0.13
|
||||
# https://specifications.freedesktop.org/icon-theme-spec/latest/
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_ftp -d 'Complete ftp, pftp' --argument-names ftp
|
||||
# localization: tier3
|
||||
function __fish_complete_ftp --argument-names ftp
|
||||
# Common across all ftp implementations
|
||||
complete -c $ftp -xa "(__fish_print_hostnames)" -d Hostname
|
||||
complete -c $ftp -s 4 -d 'Use IPv4 only'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
#
|
||||
# Completions for the gpg program.
|
||||
#
|
||||
@@ -15,7 +16,7 @@
|
||||
# removed. The remaining list of completions is still quite
|
||||
# impressive.
|
||||
|
||||
function __fish_complete_gpg -d "Internal function for gpg completion code deduplication" -a __fish_complete_gpg_command
|
||||
function __fish_complete_gpg -a __fish_complete_gpg_command
|
||||
if string match -q 'gpg (GnuPG) 1.*' ($__fish_complete_gpg_command --version 2>/dev/null)
|
||||
complete -c $__fish_complete_gpg_command -l simple-sk-checksum -d 'Integrity protect secret keys by using a SHA-1 checksum'
|
||||
complete -c $__fish_complete_gpg_command -l no-sig-create-check -d "Do not verify each signature right after creation"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Helper function for contextual autocompletion of GPG key ids
|
||||
# localization: skip(private)
|
||||
|
||||
# Helper function for contextual autocompletion of GPG key ids
|
||||
function __fish_complete_gpg_key_id -d 'Complete using gpg key ids' -a __fish_complete_gpg_command list_arg
|
||||
# Use user id as description
|
||||
set -l keyid
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Helper function for contextual autocompletion of gpg user ids
|
||||
# localization: skip(private)
|
||||
|
||||
# Helper function for contextual autocompletion of gpg user ids
|
||||
function __fish_complete_gpg_user_id -d "Complete using gpg user ids" -a __fish_complete_gpg_command list_arg
|
||||
# gpg doesn't seem to like it when you use the whole key name as a
|
||||
# completion, so we skip the <EMAIL> part and use it as a description.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_group_ids --description "Complete group IDs with group name as description"
|
||||
if command -sq getent
|
||||
getent group | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_groups --description "Print a list of local groups, with group members as the description"
|
||||
if command -sq getent
|
||||
getent group | while read -l line
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_job_pids --description "Print a list of job PIDs and their commands"
|
||||
if set -l jobpids (jobs -p)
|
||||
# when run at the commandline, the first line of output is a header, but
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_list --argument-names div cmd prefix iprefix
|
||||
if not set -q cmd[1]
|
||||
echo "Usage:
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_complete_lpr -d 'Complete lpr common options' --argument-names cmd
|
||||
complete -c $cmd -s E -d 'Forces encryption when connecting to the server'
|
||||
complete -c $cmd -s U -d 'Specifies an alternate username' -xa '(__fish_complete_users)'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_lpr_option --description 'Complete lpr option'
|
||||
set -l optstr "$(commandline -t)"
|
||||
switch $optstr
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_complete_magick
|
||||
complete -c $argv -o adjoin -d 'Join images into a single multi-image file'
|
||||
complete -c $argv -o affine -d 'Affine transform matrix [matrix]'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_man
|
||||
# Try to guess what section to search in. If we don't know, we
|
||||
# use [^)]*, which should match any section.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_print_user_ids
|
||||
if command -sq getent
|
||||
for line in (getent passwd)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_mysql_query -a query
|
||||
argparse -u 'u/user=' 'P/port=' 'h/host=' 'p/password=?' 'S/socket=' -- (commandline -px)
|
||||
set -l mysql_cmd mysql
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_complete_netcat
|
||||
set -l nc $argv[1]
|
||||
set -l flavor $argv[-1]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_path --description "Complete using path"
|
||||
set -l target
|
||||
set -l description
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_pg_database
|
||||
psql -AtqwlXF \t 2>/dev/null | awk 'NF > 1 { print $1 }'
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_pg_user
|
||||
psql -AtqwXc 'select usename from pg_user' template1 2>/dev/null
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_complete_pgrep -d 'Complete pgrep/pkill' --argument-names cmd
|
||||
complete -c $cmd -xa '(__fish_complete_proc)'
|
||||
complete -c $cmd -s f -d 'Match pattern against full command line'
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_pids -d "Print a list of process identifiers along with brief descriptions"
|
||||
# This may be a bit slower, but it's nice - having the tty displayed is really handy
|
||||
# 'tail -n +2' deletes the first line, which contains the headers
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_ppp_peer --description 'Complete isp name for pon/poff'
|
||||
find /etc/ppp/peers/ -type f -printf '%f\n'
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_proc
|
||||
# "comm=" means "print comm field with an empty name", which causes the header to be removed.
|
||||
# On many systems, comm is truncated (e.g. on Linux it's 15 chars),
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier3
|
||||
function __fish_complete_ssh -d "common completions for ssh commands" --argument-names command
|
||||
complete -c $command -s 4 -d "IPv4 only"
|
||||
complete -c $command -s 6 -d "IPv6 only"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_subcommand -d "Complete subcommand" --no-scope-shadowing
|
||||
# How many non-option tokens we skip in the input commandline before completing the subcommand
|
||||
# Usually 1; use "--fcs-skip=2" to make it 2 (see e.g. tmux and ssh completions)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# Find files ending in any of the non-switch arguments and output them as completions.
|
||||
# * --description provides the description that should be part of each generated completion,
|
||||
# * --prefix=DIR makes __fish_complete_suffix behave as if it were called in DIR rather than $PWD
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_user_at_hosts -d "Print list host-names with user@"
|
||||
for user_at in (commandline -ct | string match -r '.*@'; or echo "")(__fish_print_hostnames)
|
||||
echo $user_at
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_user_ids --description "Complete user IDs with user name as description"
|
||||
if command -sq getent
|
||||
getent passwd | string replace -f -r '^([[:alpha:]_][^:]*):[^:]*:(\d+).*' '$2\t$1'
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This should be used where you want user names with a description. Such as in an argument
|
||||
# completion. If you just want a list of user names use __fish_print_users.
|
||||
# The string replace command takes into account GECOS-formatted description fields, by retaining
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: tier3
|
||||
#
|
||||
# Helper functions for wireshark/tshark/dumpcap completion
|
||||
|
||||
function __fish_wireshark_choices
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_zfs_mountpoint_properties -d "Completes with ZFS mountpoint properties"
|
||||
# localization: tier3
|
||||
function __fish_complete_zfs_mountpoint_properties
|
||||
set -l OS ""
|
||||
switch (uname)
|
||||
case Linux
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_complete_zfs_pools -d "Completes with available ZFS pools"
|
||||
zpool list -o name,comment -H | string replace -a \t'-' ''
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_zfs_ro_properties -d "Completes with ZFS read-only properties"
|
||||
# localization: tier3
|
||||
function __fish_complete_zfs_ro_properties
|
||||
echo -e "available\tAvailable space"
|
||||
echo -e "avail\tAvailable space"
|
||||
echo -e "compressratio\tAchieved compression ratio"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_zfs_rw_properties -d "Completes with ZFS read-write properties"
|
||||
# localization: tier3
|
||||
function __fish_complete_zfs_rw_properties
|
||||
set -l OS ""
|
||||
switch (uname)
|
||||
case Linux
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
function __fish_complete_zfs_write_once_properties -d "Completes with ZFS properties which can only be written at filesystem creation, and only be read thereafter"
|
||||
# localization: tier3
|
||||
function __fish_complete_zfs_write_once_properties
|
||||
set -l OS ""
|
||||
switch (uname)
|
||||
case Linux
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This function is intended to be used to generate completions in `-a "(...)"` calls for arguments that take 1..n values
|
||||
# separated by commas and we dynamically or statically generated a list of n values that must be combined and permuted
|
||||
# in order to appease both the `complete` machinery and the target application.
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# Initializations that should only be performed when entering interactive mode.
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_contains_opt -d "Checks if a specific option has been given in the current commandline"
|
||||
set -l next_short
|
||||
set -l short_opt
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# a function to obtain a list of installed packages with CRUX pkgutils
|
||||
function __fish_crux_packages -d 'Obtain a list of installed packages'
|
||||
pkginfo -i | string split -f1 ' '
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cursor_konsole -d 'Set cursor (konsole)'
|
||||
set -l shape $argv[1]
|
||||
switch "$shape"
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_cursor_xterm -d 'Set cursor (xterm)'
|
||||
set -l shape $argv[1]
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
#
|
||||
# This function is used internally by the fish command completion code
|
||||
#
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
set -l erase_line "$(
|
||||
if status test-feature ignore-terminfo
|
||||
echo \e\[K
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: tier1
|
||||
function __fish_edit_command_if_at_cursor --description 'If cursor is at the command token, edit the command source file'
|
||||
set -l tokens (commandline -xpc)
|
||||
set -l command
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
# Retrieves the first non-switch argument from the command line buffer
|
||||
function __fish_first_token
|
||||
set -l tokens (commandline -cx)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(deprecated)
|
||||
function __fish_git_prompt
|
||||
# TODO: This name is deprecated, figure out a way to tell users.
|
||||
fish_git_prompt $argv
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
function __fish_gnu_complete -d "Wrapper for the complete built-in. Skips the long completions on non-GNU systems"
|
||||
set -l is_gnu 0
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(deprecated)
|
||||
function __fish_hg_prompt
|
||||
fish_hg_prompt
|
||||
end
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# localization: skip(private)
|
||||
set -l dir "$(path dirname -- (status fish-path 2>/dev/null))"
|
||||
|
||||
if command -v $dir/fish_indent >/dev/null
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user