Compare commits

..

7 Commits

Author SHA1 Message Date
Johannes Altmanninger
d573dd9f79 Release 4.8.0
Created by ./build_tools/release.sh 4.8.0
2026-06-24 11:59:34 +02:00
Johannes Altmanninger
be58b66c82 Update changelog 2026-06-24 09:10:39 +02:00
Johannes Altmanninger
fa8a2ee265 complete short_opt_pos: repeated short options are not invalid
complete -C"somecmd -xyz" will not suggest any of the short options
that are already present.  This is old behavior from 149594f974
(Initial revision, 2005-09-20) ("if( wcschr( arg, nextopt ) != 0 )").
It's questionable, since repeated options may be valid ("ssh -vvv"
etc.), and completions should generally err on the side of false
positives; but given that short options are usually easy to type,
and discovery is not really relevant if they are already on the
command line, this seems fine? Not sure.

Recently, fab397e754 (fix: filter invalid short option completions,
2026-06-18) made two changes:

1. "complete somecmd -s X -n false; complete -C'somecmd -X'" no longer
   prints completions. This is a bug fix that reduces confusion.
2. complete -C"somecmd -YY" where "Y" no longer completes other short
   options because we treat repetition as error. But it's not
   necessarily, and hiding unrelated completions seems wrong.

Revert change 2.

See https://github.com/fish-shell/fish-shell/pull/12821#issuecomment-4781863199
2026-06-24 08:49:59 +02:00
Johannes Altmanninger
6fd86a6e9b complete short_option_pos: use find again instead of raw loop
Reverts that part of ab397e7546 (fix: filter invalid short option
completions, 2026-06-18).

While at it, clean up a comment and assertion from eae1683033
(Completion: complete argument to last of a group of short options,
2019-09-10).
2026-06-24 08:49:59 +02:00
Johannes Altmanninger
becded65d2 completions/dnf: namespace helper functions properly 2026-06-23 18:43:35 +02:00
Johannes Altmanninger
36a6659390 docker: update fedora/suse dockerfiles 2026-06-23 18:11:58 +02:00
Drazape
eb8f53c48d fix: completions: fish_opt: correct flag: long(+:-)only
Closes #12827
2026-06-23 18:11:58 +02:00
21 changed files with 84 additions and 259 deletions

View File

@@ -1,33 +0,0 @@
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,56 +10,8 @@ permissions:
contents: read
jobs:
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 }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2, build_tools/update-dependencies.sh
- uses: ./.github/actions/rust-toolchain@oldest-supported

View File

@@ -1,38 +1,40 @@
fish ?.?.? (released ???)
=========================
fish 4.8.0 (released June 24, 2026)
===================================
Notable improvements and fixes
------------------------------
- Translatable messages defined in Rust source code may now be localized using `Fluent <https://projectfluent.org/>`__ instead of GNU gettext.
- Translatable messages defined in Rust source code can and should now be translated 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
---------------------------------
- The ``--command`` and ``--path`` options in :doc:`complete <cmds/complete>` no longer unescape their argument.
- Builtin :doc:`complete's <cmds/complete>` ``--command`` and ``--path`` options 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.
- Completions no longer offer repeated short options (:issue:`12821`).
- Fixed an issue where control-C might fail to cancel certain functions (:issue:`12802`).
- 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`).
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 or deleted (:issue:`12700`).
- ``cd`` with a relative path will now retry using the real current directory, if ``$PWD`` has been moved (: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 universal variables by default; specifically, the ``__fish_initialized`` variable is no longer created.
- fish no longer creates the ``__fish_initialized`` universal variable on startup.
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
-------------------------------
@@ -53,7 +55,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 input would insert garbage text into the command line (:issue:`12379`).
- (from 4.3.0) Pressing escape during command execution could 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.7.1"
version = "4.8.0"
dependencies = [
"assert_matches",
"bitflags",

View File

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

View File

@@ -35,7 +35,6 @@ 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,3 +1,11 @@
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.

View File

@@ -1,45 +0,0 @@
# 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,9 +11,15 @@ EOF
exit 1
}
DOCKER_EXTRA_ARGS=""
export DOCKER_BUILDKIT=1
# Exit on failure.
set -e
DOCKER_EXTRA_ARGS=""
# Get fish source directory.
workspace_root=$(cd "$( dirname "$0" )"/.. >/dev/null && pwd)
# Parse args.
while [ $# -gt 1 ]; do
@@ -37,19 +43,19 @@ while [ $# -gt 1 ]; do
shift
done
dockerfile=$1
test -n "$dockerfile" || usage
DOCKERFILE="$1"
test -n "$DOCKERFILE" || usage
workspace_root=$(cd "$( dirname "$0" )"/.. >/dev/null && pwd)
. "$workspace_root"/docker/lib.sh
docker_build "$dockerfile"
# 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/
# 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 -i $(isatty 0 && printf %s -t) \
docker run -it \
--mount type=bind,source="$workspace_root",target=/fish-source,readonly \
$DOCKER_EXTRA_ARGS \
"$(image_tagname "$dockerfile")"
"$IMG_TAGNAME"

View File

@@ -2,15 +2,17 @@ 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 \
openssl \
procps \
sudo && \
rust \
sudo \
&& \
dnf clean all
RUN pip3 install pexpect

View File

@@ -1,24 +0,0 @@
#!/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,7 +7,6 @@ ENV LC_ALL=C.UTF-8
RUN zypper --non-interactive install \
bash \
diffutils \
gcc-c++ \
git-core \
pcre2-devel \
python311 \

View File

@@ -1,19 +0,0 @@
#!/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 __dnf_is_dnf5
function __fish_dnf_is_dnf5
path resolve -- $PATH/dnf | path filter | string match -q -- '*/dnf5'
end
function __dnf_list_installed_packages
function __fish_dnf_list_installed_packages
dnf repoquery --cacheonly "$cur*" --qf "%{name}\n" --installed </dev/null
end
function __dnf_list_copr_repos
function __fish_dnf_list_copr_repos
set -l copr_repos (dnf copr list)
switch $argv[1]
@@ -23,7 +23,7 @@ function __dnf_list_copr_repos
end
end
function __dnf_list_available_packages
function __fish_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 __dnf_list_available_packages
return
end
set -l results
if __dnf_is_dnf5
if __fish_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 __dnf_list_available_packages
string join \n $results
end
function __dnf_list_transactions
if not __dnf_is_dnf5 && type -q sqlite3
function __fish_dnf_list_transactions
if not __fish_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 "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from autoremove" -xa "(__fish_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 "(__dnf_list_copr_repos $i)"
complete -c dnf -n "__fish_seen_subcommand_from copr; and __fish_seen_subcommand_from $i" -xa "(__fish_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 "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from downgrade" -xa "(__fish_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 "(__dnf_list_transactions)"
complete -c dnf -n "__fish_seen_subcommand_from history; and __fish_seen_subcommand_from $i" -xa "(__fish_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 "(__dnf_list_available_packages)"
-k -xa "(__fish_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 "(__dnf_list_available_packages)"
-k -xa "(__fish_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 "(__dnf_list_installed_packages)"
-xa "(__fish_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 "(__dnf_list_installed_packages)"
-xa "(__fish_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 "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from upgrade" -xa "(__fish_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 "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from upgrade-minimal" -xa "(__fish_dnf_list_installed_packages)"
# Versionlock
if test -f /etc/dnf/plugins/versionlock.conf
function __dnf_current_versionlock_list
function __fish_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 "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from add" -xa "(__fish_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 "(__dnf_list_installed_packages)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from exclude" -xa "(__fish_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 "(__dnf_current_versionlock_list)"
complete -c dnf -n "__fish_seen_subcommand_from versionlock; and __fish_seen_subcommand_from delete" -xa "(__fish_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 longonly --description 'Use only long option'
complete --command fish_opt --long-option long-only --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,26 +908,17 @@ 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 mut matched = None;
for o in options {
if o.typ == CompleteOptionType::Short
let matched = options.iter().find(|o| {
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 {
@@ -2229,8 +2220,10 @@ fn param_match(e: &CompleteEntryOpt, optstr: &wstr) -> bool {
}
}
/// Test if a string is an option with an argument, like --color=auto or -I/usr/include.
/// Test if a string is an option with an argument, like --color=auto or -std=c++26.
/// Short options are handled by the caller.
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;
@@ -2250,7 +2243,6 @@ 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,10 +153,11 @@ 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' | count
# CHECK: 0
complete -C'repeated_short_options -xxh' | count
# CHECK: 0
complete -C'repeated_short_options -xx'
# CHECK: -xxh
# CHECK: -xxv
complete -C'repeated_short_options -xxh'
# CHECK: -xxhv
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() == "Darwin":
if "CI" in os.environ and platform.system() in ["Darwin", "FreeBSD"]:
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() == "Darwin":
if "CI" in os.environ and platform.system() in ["Darwin", "FreeBSD"]:
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() == "Darwin":
if "CI" in os.environ and platform.system() in ["Darwin", "FreeBSD"]:
sys.exit(127)
sp = SpawnedProc()

View File

@@ -1,13 +1,6 @@
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:
@@ -24,14 +17,6 @@ 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