Compare commits

..

5 Commits

Author SHA1 Message Date
Johannes Altmanninger
a0e73a8721 build_docker_images: use shell script instead of reusable github actions
We already want to use the Docker CLI in docker/docker_run_tests.sh,
so it seems wrong to also use the github-specific wrappers.

Let the CI use shell scripts too.
2026-06-23 11:08:52 +02:00
Johannes Altmanninger
ddc52eb5c1 Cache docker images used by CI
The alpine docker images builds quickly but if we want to use this
approach for all the ubuntu configurations as well, we might want to
cache it.

Do this by reverting dc9668c8a4 (Remove unused workflow to build
docker images, 2026-05-30), except:
- Remove "attestations" and "id-token" permissions; I'm not sure if these are necessary
- Given that our CI uses docker/docker_run_tests.sh which will always
  rebuild if necessary (i.e. only use the registry as cache), run on
  all branches, not just on master, for correctness.
- Let the builder use caching as well, I guess.

Part of #12626
2026-06-23 11:08:52 +02:00
Johannes Altmanninger
234fda7a0b Add FreeBSD to github CI
Reintroduces more of ff0afd14c2 (Remove Cirrus CI, 2026-05-28).
Don't pin the FreeBSD version, though we could do that in future.

While at it, remove some stale expected failures.

Closes #12626
2026-06-23 11:08:52 +02:00
Johannes Altmanninger
3f89550e51 Add Ubuntu arm64 to github CI
Not sure if this adds meaningful coverage but this is one of the things
that .cirrus.yml used to have (also: armv7-32bit).  Github seems
to provide arm64 natively, so maybe use that for now.

Part of #12626
2026-06-23 11:05:56 +02:00
Johannes Altmanninger
e02e11ba69 Add Alpine to github actions CI
Restores Alpine CI as removed in these commits:

- ff0afd14c2 (Remove Cirrus CI, 2026-05-28)
- f48166ff36 (update-dependencies: remove things used for Cirrus, 2026-05-29)
- dc9668c8a4 (Remove unused workflow to build docker images, 2026-05-30)

See following commits for the rest.

Part of #12626
2026-06-23 11:04:55 +02:00
21 changed files with 259 additions and 84 deletions

View File

@@ -0,0 +1,33 @@
name: Build Docker test images
on:
push:
paths:
- 'docker/**'
workflow_dispatch:
concurrency:
group: docker-builds
jobs:
docker-build:
if: github.repository_owner == 'fish-shell'
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
target: alpine
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
- run: |
printf %s "${{ secrets.GITHUB_TOKEN }}" |
docker login ghcr.io --username=${{ github.actor }} --password-stdin
docker/push.sh docker/${{ matrix.target }}.Dockerfile

View File

@@ -10,10 +10,58 @@ permissions:
contents: read
jobs:
ubuntu:
alpine:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
- run:
docker/docker_run_tests.sh docker/alpine.Dockerfile
freebsd:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
- uses: vmactions/freebsd-vm@21de0c823079bc57bd8fcf25fb60193f36887e3d # v1, build_tools/update-dependencies.sh
with:
# # See https://github.com/vmactions/.github/wiki/debug%E2%80%90on%E2%80%90error
# debug-on-error: true
# vnc-password: fish
usesh: true
run: |
pkg update
# TODO This should be shared with .github/actions/install-dependencies/action.yml
pkg install -y \
cmake-core \
devel/ninja \
devel/pcre2 \
gettext \
git-lite \
lang/rust \
misc/py-pexpect \
python \
sudo \
;
# BSDs have the following behavior: root may open or access files even if
# the mode bits would otherwise disallow it. For example root may open()
# a file with write privileges even if the file has mode 400. This breaks
# our tests for e.g. cd and path. So create a new unprivileged user to run tests.
pw user add -n fish-user -s /bin/csh -d /home/fish-user
mkdir -p /home/fish-user
chown -R fish-user /home/fish-user
mkdir build && cd build
chown -R fish-user ..
sudo -u fish-user -s whoami
sudo -u fish-user -s FISH_TEST_MAX_CONCURRENCY=1 cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
sudo -u fish-user -s ninja fish
sudo -u fish-user -s env CI=1 ninja fish_run_tests
ubuntu:
strategy:
matrix:
os: [ubuntu-latest, ubuntu-latest-arm64]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
- uses: ./.github/actions/rust-toolchain@oldest-supported
- name: Install deps
uses: ./.github/actions/install-dependencies

View File

@@ -1,40 +1,38 @@
fish 4.8.0 (released June 24, 2026)
===================================
fish ?.?.? (released ???)
=========================
Notable improvements and fixes
------------------------------
- Translatable messages defined in Rust source code can and should now be translated using `Fluent <https://projectfluent.org/>`__ instead of GNU gettext.
- Translatable messages defined in Rust source code may now be localized using `Fluent <https://projectfluent.org/>`__ instead of GNU gettext.
To make Fluent easy to work with, we have added tooling based on the new `fluent-ftl-tools <https://codeberg.org/danielrainer/fluent-ftl-tools>`__ library.
See :ref:`Contributing Translations <localization>` (:issue:`11928`).
Deprecations and removed features
---------------------------------
- Builtin :doc:`complete's <cmds/complete>` ``--command`` and ``--path`` options no longer unescape their argument.
- The ``--command`` and ``--path`` options in :doc:`complete <cmds/complete>` no longer unescape their argument.
Interactive improvements
------------------------
- History search would sometimes forget about commands after those were re-run in concurrent sessions. This has been fixed (:issue:`10300`).
- On the first run after upgrading from an older version, fish will try harder to check if the current theme matches a historical default. If it does match, fish won't create ``~/.config/fish/conf.d/fish_frozen_theme.fish`` when upgrading from fish < 4.3.
Specifically, on systems where fish version 3.x was installed originally, fish 4.8 will avoid creating that file on upgrade (:issue:`12725`).
- ``fish_hg_prompt``, ``fish_git_prompt`` and ``fish_fossil_prompt`` now strip control characters from VCS state read off disk, matching ``prompt_pwd``.
- :doc:`bind <cmds/bind>` shows the file where bindings were defined (:issue:`12504`).
- Abbreviations with ``--position=anywhere`` can now be completed in argument position, not just in command position (:issue:`12630`).
- Path component movement (:kbd:`ctrl-w`) skips escaped characters.
- Completion of short option groups will now handle ``--condition`` correctly (:issue:`12821`).
- Fixed an issue where :kbd:`ctrl-c` might fail to cancel certain functions (:issue:`12802`).
- On the first run after upgrading from an older version, fish will try harder to check if the current theme matches a historical default.
If it does match, fish won't create ``~/.config/fish/conf.d/fish_frozen_theme.fish`` when upgrading from fish < 4.3.
In particular, on systems where fish version 3.x was installed originally, fish will now avoid creating that file on upgrade (:issue:`12725`).
- Completions no longer offer repeated short options (:issue:`12821`).
- Fixed an issue where control-C might fail to cancel certain functions (:issue:`12802`).
Scripting improvements
----------------------
- ``cd`` supports the ``-L`` and ``-P`` options, like other shells, to allow specifying whether symbolic links (symlinks) are resolved when changing directories (:issue:`7206`).
- ``cd`` with a relative path will now retry using the real current directory, if ``$PWD`` has been moved (:issue:`12700`).
- ``cd`` with a relative path will now retry using the real current directory, if ``$PWD`` has been moved or deleted (:issue:`12700`).
- Nested brace expansions now strip unquoted leading and trailing spaces from entries consistently (:issue:`12794`).
- :doc:`bind <cmds/bind>` shows the files where bindings were defined (:issue:`12504`).
Other improvements
------------------
- fish no longer creates the ``__fish_initialized`` universal variable on startup.
- fish no longer creates universal variables by default; specifically, the ``__fish_initialized`` variable is no longer created.
If you don't expect to need to downgrade to earlier versions, you can remove it with ``set --erase __fish_initialized``.
This means that fish now only creates universal variables if instructed by the user.
For distributors and developers
-------------------------------
@@ -55,7 +53,7 @@ Regression fixes:
- (from 4.4.0) Vi mode ``c,W`` key binding wrongly deleted trailing spaces (:issue:`12790`).
- (from 4.4.0) Vi mode ``x`` in :doc:`builtin read <cmds/read>` (:issue:`12724`).
- (from 4.3.3) Repeated tab would sometimes insert smartcase completions redundantly.
- (from 4.3.0) Pressing escape during command execution could insert garbage text into the command line (:issue:`12379`).
- (from 4.3.0) Pressing escape during command input would insert garbage text into the command line (:issue:`12379`).
fish 4.7.1 (released May 08, 2026)
==================================

2
Cargo.lock generated
View File

@@ -334,7 +334,7 @@ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
[[package]]
name = "fish"
version = "4.8.0"
version = "4.7.1"
dependencies = [
"assert_matches",
"bitflags",

View File

@@ -106,7 +106,7 @@ debug = true
[package]
name = "fish"
version = "4.8.0"
version = "4.7.1"
edition.workspace = true
rust-version.workspace = true
default-run = "fish"

View File

@@ -35,6 +35,7 @@ update_gh_action dessant/lock-threads
update_gh_action EmbarkStudios/cargo-deny-action
update_gh_action msys2/setup-msys2
update_gh_action softprops/action-gh-release
update_gh_action vmactions/freebsd-vm
updatecli "${@:-apply}"

View File

@@ -1,11 +1,3 @@
fish (4.8.0-1) stable; urgency=medium
* Release of new version 4.8.0.
See https://github.com/fish-shell/fish-shell/releases/tag/4.8.0 for details.
-- Johannes Altmanninger <aclopte@gmail.com> Wed, 24 Jun 2026 11:59:34 +0200
fish (4.7.1-1) stable; urgency=medium
* Release of new version 4.7.1.

45
docker/alpine.Dockerfile Normal file
View File

@@ -0,0 +1,45 @@
# Version set by updatecli.d/docker.yml
FROM alpine:3.23
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
RUN apk add --no-cache \
bash \
cargo \
g++ \
gettext-dev \
git \
libintl \
musl-dev \
pcre2-dev \
py3-pexpect \
py3-pip \
python3 \
rust \
sudo \
tmux
RUN addgroup -g 1000 fishuser
RUN adduser \
--disabled-password \
--gecos "" \
--home "/home/fishuser" \
--ingroup fishuser \
--uid 1000 \
fishuser
RUN mkdir -p /home/fishuser/fish-build \
&& mkdir /fish-source \
&& chown -R fishuser:fishuser /home/fishuser /fish-source
USER fishuser
WORKDIR /home/fishuser
COPY fish_run_tests.sh /
ENV FISH_CHECK_LINT=false
CMD /fish_run_tests.sh

View File

@@ -11,15 +11,9 @@ EOF
exit 1
}
DOCKER_EXTRA_ARGS=""
export DOCKER_BUILDKIT=1
# Exit on failure.
set -e
# Get fish source directory.
workspace_root=$(cd "$( dirname "$0" )"/.. >/dev/null && pwd)
DOCKER_EXTRA_ARGS=""
# Parse args.
while [ $# -gt 1 ]; do
@@ -43,19 +37,19 @@ while [ $# -gt 1 ]; do
shift
done
DOCKERFILE="$1"
test -n "$DOCKERFILE" || usage
dockerfile=$1
test -n "$dockerfile" || usage
# Construct a docker image.
IMG_TAGNAME="ghcr.io/fish-shell/fish-ci/$(basename -s .Dockerfile "$DOCKERFILE"):latest"
docker build \
-t "$IMG_TAGNAME" \
-f "$DOCKERFILE" \
"$workspace_root"/docker/context/
workspace_root=$(cd "$( dirname "$0" )"/.. >/dev/null && pwd)
. "$workspace_root"/docker/lib.sh
docker_build "$dockerfile"
# Run tests in it, allowing them to fail without failing this script.
# shellcheck disable=SC2046 # for the isatty snippet
# shellcheck disable=SC2086 # $DOCKER_EXTRA_ARGS should have globbing and splitting applied.
docker run -it \
docker run -i $(isatty 0 && printf %s -t) \
--mount type=bind,source="$workspace_root",target=/fish-source,readonly \
$DOCKER_EXTRA_ARGS \
"$IMG_TAGNAME"
"$(image_tagname "$dockerfile")"

View File

@@ -2,17 +2,15 @@ FROM fedora:latest
LABEL org.opencontainers.image.source=https://github.com/fish-shell/fish-shell
RUN dnf install --assumeyes \
cargo \
diffutils \
gcc-c++ \
git-core \
openssl \
pcre2-devel \
procps \
python3 \
python3-pip \
rust \
sudo \
&& \
openssl \
procps \
sudo && \
dnf clean all
RUN pip3 install pexpect

24
docker/lib.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# Get fish source directory.
set -e
# shellcheck disable=SC2154
test -n "$workspace_root"
image_tagname() {
printf %s "ghcr.io/fish-shell/fish-ci/$(basename -s .Dockerfile "$1"):latest"
}
docker_build() {
dockerfile=$1
shift
tagname=$(image_tagname "$dockerfile")
docker pull "$tagname" || true
DOCKER_BUILDKIT=1 \
docker build \
--cache-from "$tagname" \
-t "$tagname" \
-f "$dockerfile" \
"$workspace_root"/docker/context/ \
"$@"
}

View File

@@ -7,6 +7,7 @@ ENV LC_ALL=C.UTF-8
RUN zypper --non-interactive install \
bash \
diffutils \
gcc-c++ \
git-core \
pcre2-devel \
python311 \

19
docker/push.sh Executable file
View File

@@ -0,0 +1,19 @@
#!/bin/sh
usage() {
cat << EOF
Usage: $(basename "$0") DOCKERFILE
EOF
exit 1
}
set -e
dockerfile=$1
test -n "$dockerfile" || usage
workspace_root=$(cd "$( dirname "$0" )"/.. >/dev/null && pwd)
. "$workspace_root"/docker/lib.sh
docker_build "$dockerfile" --cache-to=type=inline
docker push "$(image_tagname "$dockerfile")"

View File

@@ -2,15 +2,15 @@
# Completions for the dnf command
#
function __fish_dnf_is_dnf5
function __dnf_is_dnf5
path resolve -- $PATH/dnf | path filter | string match -q -- '*/dnf5'
end
function __fish_dnf_list_installed_packages
function __dnf_list_installed_packages
dnf repoquery --cacheonly "$cur*" --qf "%{name}\n" --installed </dev/null
end
function __fish_dnf_list_copr_repos
function __dnf_list_copr_repos
set -l copr_repos (dnf copr list)
switch $argv[1]
@@ -23,7 +23,7 @@ function __fish_dnf_list_copr_repos
end
end
function __fish_dnf_list_available_packages
function __dnf_list_available_packages
set -l tok (commandline -ct | string collect)
set -l files (__fish_complete_suffix .rpm)
if string match -q -- '*/*' $tok
@@ -32,7 +32,7 @@ function __fish_dnf_list_available_packages
return
end
set -l results
if __fish_dnf_is_dnf5
if __dnf_is_dnf5
# dnf5 provides faster completions than repoquery, but does not maintain the
# same sqlite db as dnf4
set results (dnf --complete=2 dnf install "$tok*")
@@ -58,8 +58,8 @@ function __fish_dnf_list_available_packages
string join \n $results
end
function __fish_dnf_list_transactions
if not __fish_dnf_is_dnf5 && type -q sqlite3
function __dnf_list_transactions
if not __dnf_is_dnf5 && type -q sqlite3
sqlite3 /var/lib/dnf/history.sqlite "SELECT id, cmdline FROM trans" 2>/dev/null | string replace "|" \t
end
end
@@ -78,7 +78,7 @@ complete -c dnf -n "__fish_seen_subcommand_from alias" -xa delete -d "Delete an
# Autoremove
complete -c dnf -n __fish_use_subcommand -xa autoremove -d "Removes unneeded packages"
complete -c dnf -n "__fish_seen_subcommand_from autoremove" -xa "(__fish_dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from autoremove" -xa "(__dnf_list_installed_packages)"
# Check
complete -c dnf -n __fish_use_subcommand -xa check -d "Check for problems in packagedb"
@@ -110,7 +110,7 @@ complete -c dnf -n "__fish_seen_subcommand_from copr; and not __fish_seen_subcom
complete -c dnf -n "__fish_seen_subcommand_from copr; and not __fish_seen_subcommand_from $coprcommands" -l hub -d "Copr hub hostname"
for i in enable disable remove
complete -c dnf -n "__fish_seen_subcommand_from copr; and __fish_seen_subcommand_from $i" -xa "(__fish_dnf_list_copr_repos $i)"
complete -c dnf -n "__fish_seen_subcommand_from copr; and __fish_seen_subcommand_from $i" -xa "(__dnf_list_copr_repos $i)"
end
# Distro-sync
@@ -118,7 +118,7 @@ complete -c dnf -n __fish_use_subcommand -xa distro-sync -d "Synchronizes packag
# Downgrade
complete -c dnf -n __fish_use_subcommand -xa downgrade -d "Downgrades the specified package"
complete -c dnf -n "__fish_seen_subcommand_from downgrade" -xa "(__fish_dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from downgrade" -xa "(__dnf_list_installed_packages)"
# Group
complete -c dnf -n __fish_use_subcommand -xa group -d "Manage groups"
@@ -156,18 +156,18 @@ complete -c dnf -n "__fish_seen_subcommand_from history" -xa undo -d "Undoes the
complete -c dnf -n "__fish_seen_subcommand_from history" -xa userinstalled -d "Lists all user installed packages"
for i in info redo rollback undo
complete -c dnf -n "__fish_seen_subcommand_from history; and __fish_seen_subcommand_from $i" -xa "(__fish_dnf_list_transactions)"
complete -c dnf -n "__fish_seen_subcommand_from history; and __fish_seen_subcommand_from $i" -xa "(__dnf_list_transactions)"
end
# Info
complete -c dnf -n __fish_use_subcommand -xa "$dnf_info_cmds" -d "Describes the given package"
complete -c dnf -n "__fish_seen_subcommand_from $dnf_info_cmds; and not __fish_seen_subcommand_from history" \
-k -xa "(__fish_dnf_list_available_packages)"
-k -xa "(__dnf_list_available_packages)"
# Install
complete -c dnf -n __fish_use_subcommand -xa "$dnf_install_cmds" -d "Install package"
complete -c dnf -n "__fish_seen_subcommand_from $dnf_install_cmds" \
-k -xa "(__fish_dnf_list_available_packages)"
-k -xa "(__dnf_list_available_packages)"
# List
complete -c dnf -n __fish_use_subcommand -xa list -d "Lists all packages"
@@ -227,12 +227,12 @@ complete -c dnf -n __fish_use_subcommand -xa provides -d "Finds packages providi
# Reinstall
complete -c dnf -n __fish_use_subcommand -xa "$dnf_reinstall_cmds" -d "Reinstalls a package"
complete -c dnf -n "__fish_seen_subcommand_from $dnf_reinstall_cmds" \
-xa "(__fish_dnf_list_installed_packages)"
-xa "(__dnf_list_installed_packages)"
# Remove
complete -c dnf -n __fish_use_subcommand -xa "$dnf_remove_cmds" -d "Remove packages"
complete -c dnf -n "__fish_seen_subcommand_from $dnf_remove_cmds" \
-xa "(__fish_dnf_list_installed_packages)"
-xa "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from remove" -l duplicates -d "Removes older version of duplicated packages"
complete -c dnf -n "__fish_seen_subcommand_from remove" -l oldinstallonly -d "Removes old installonly packages"
@@ -340,28 +340,28 @@ complete -c dnf -n "__fish_seen_subcommand_from updateinfo" -l updates
# Upgrade
complete -c dnf -n __fish_use_subcommand -xa upgrade -d "Updates packages"
complete -c dnf -n "__fish_seen_subcommand_from upgrade" -xa "(__fish_dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from upgrade" -xa "(__dnf_list_installed_packages)"
# Upgrade-Minimal
complete -c dnf -n __fish_use_subcommand -xa upgrade-minimal -d "Updates packages"
complete -c dnf -n "__fish_seen_subcommand_from upgrade-minimal" -xa "(__fish_dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from upgrade-minimal" -xa "(__dnf_list_installed_packages)"
# Versionlock
if test -f /etc/dnf/plugins/versionlock.conf
function __fish_dnf_current_versionlock_list
function __dnf_current_versionlock_list
dnf versionlock list | grep -v metadata
end
complete -c dnf -n __fish_use_subcommand -xa versionlock -d "DNF versionlock plugin"
# - add
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa add -d "Add a versionlock for all available packages matching the spec"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from add" -xa "(__fish_dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from add" -xa "(__dnf_list_installed_packages)"
# - exclude
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa exclude -d "Add an exclude (within versionlock) for the available packages matching the spec"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from exclude" -xa "(__fish_dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from exclude" -xa "(__dnf_list_installed_packages)"
# - delete
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa delete -d "Remove any matching versionlock entries"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from delete" -xa "(__fish_dnf_current_versionlock_list)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from delete" -xa "(__dnf_current_versionlock_list)"
# - list
complete -c dnf -n "__fish_seen_subcommand_from versionlock" -xa list -d "List the current versionlock entries"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from list" -xa "(false)"

View File

@@ -8,7 +8,7 @@ complete --command fish_opt --short-option h --long-option help --description 'S
complete --command fish_opt --short-option s --long-option short --no-files --require-parameter --description 'Specify short option'
complete --command fish_opt --short-option l --long-option long --no-files --require-parameter --description 'Specify long option'
complete --command fish_opt --long-option long-only --description 'Use only long option'
complete --command fish_opt --long-option longonly --description 'Use only long option'
complete --command fish_opt --short-option o --long-option optional-val -n $CONDITION --description 'Don\'t require value'
complete --command fish_opt --short-option r --long-option required-val -n $CONDITION --description 'Require value'
complete --command fish_opt --short-option m --long-option multiple-vals --description 'Store all values'

View File

@@ -908,17 +908,26 @@ fn short_option_pos(&mut self, arg: &wstr, options: &[CompleteEntryOpt]) -> Opti
return None;
}
let mut seen_short_options = HashSet::new();
for (pos, arg_char) in arg.chars().enumerate().skip(1) {
let matched = options.iter().find(|o| {
o.typ == CompleteOptionType::Short
let mut matched = None;
for o in options {
if o.typ == CompleteOptionType::Short
&& o.option.char_at(0) == arg_char
&& self.conditions_test(&o.conditions)
});
{
matched = Some(o);
break;
}
}
if let Some(matched) = matched {
if matched.result_mode.requires_param {
return Some(pos);
}
if !seen_short_options.insert(arg_char) {
return None;
}
} else {
// The first character after the dash is not a valid option.
if pos == 1 {
@@ -2220,10 +2229,8 @@ fn param_match(e: &CompleteEntryOpt, optstr: &wstr) -> bool {
}
}
/// Test if a string is an option with an argument, like --color=auto or -std=c++26.
/// Short options are handled by the caller.
/// Test if a string is an option with an argument, like --color=auto or -I/usr/include.
fn param_match2(e: &CompleteEntryOpt, optstr: &wstr) -> Option<usize> {
assert!(e.typ != CompleteOptionType::Short);
// We may get a complete_entry_opt_t with no options if it's just arguments.
if e.option.is_empty() {
return None;
@@ -2243,6 +2250,7 @@ fn param_match2(e: &CompleteEntryOpt, optstr: &wstr) -> Option<usize> {
// Short options are like -DNDEBUG. Long options are like --color=auto. So check for an equal
// sign for long options.
assert!(e.typ != CompleteOptionType::Short);
if optstr.char_at(cursor) != '=' {
return None;
}

View File

@@ -153,11 +153,10 @@ end
complete -c repeated_short_options -f -s h
complete -c repeated_short_options -f -s v
complete -c repeated_short_options -f -s x
complete -C'repeated_short_options -xx'
# CHECK: -xxh
# CHECK: -xxv
complete -C'repeated_short_options -xxh'
# CHECK: -xxhv
complete -C'repeated_short_options -xx' | count
# CHECK: 0
complete -C'repeated_short_options -xxh' | count
# CHECK: 0
complete -C'repeated_short_options -x'
# CHECK: -xh
# CHECK: -xv

View File

@@ -5,7 +5,7 @@ import sys
import signal
import platform
if "CI" in os.environ and platform.system() in ["Darwin", "FreeBSD"]:
if "CI" in os.environ and platform.system() == "Darwin":
sys.exit(127)
sp = SpawnedProc()

View File

@@ -6,7 +6,7 @@ import sys
import time
import platform
if "CI" in os.environ and platform.system() in ["Darwin", "FreeBSD"]:
if "CI" in os.environ and platform.system() == "Darwin":
sys.exit(127)
sp = SpawnedProc()

View File

@@ -5,7 +5,7 @@ import signal
import sys
from pexpect_helper import SpawnedProc
if "CI" in os.environ and platform.system() in ["Darwin", "FreeBSD"]:
if "CI" in os.environ and platform.system() == "Darwin":
sys.exit(127)
sp = SpawnedProc()

View File

@@ -1,6 +1,13 @@
name: "Update Linux docker images"
sources:
alpine_latest_version:
kind: dockerimage
spec:
image: alpine
tagfilter: "^[0-9]+\\.[0-9]+$"
versionfilter:
kind: semver
ubuntu_latest_lts_version:
kind: shell
spec:
@@ -17,6 +24,14 @@ sources:
tail -1
targets:
update_alpine_dockerfile:
name: "Update Alpine Linux version"
sourceid: alpine_latest_version
kind: file
spec:
file: docker/alpine.Dockerfile
matchpattern: "FROM alpine:.*"
replacepattern: 'FROM alpine:{{ source "alpine_latest_version" }}'
ubuntu_latest_version_dockerfile:
name: "Update oldest non-EOL Ubuntu Linux version"
sourceid: ubuntu_latest_lts_version