man.fish: fix for commands ! . : [

[ja: add test]

Closes #11956
This commit is contained in:
traal
2025-10-16 12:43:32 +02:00
committed by Johannes Altmanninger
parent cab6b97539
commit 165e0d0ed5
3 changed files with 19 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ fish 4.1.3 (released ???)
This release fixes the following regressions identified in 4.1.0:
- Crash on invalid :doc:`function <cmds/function>` command (:issue:`11912`).
- Fixed the fish ``man`` function for the commands ``!`` ``.`` ``:`` ``[`` (:issue:`11955`).
as well as the following regressions identified in 4.0.0:

View File

@@ -47,13 +47,13 @@ function man
# So we override them with the good name.
switch $argv
case !
set $argv not
set argv not
case .
set $argv source
set argv source
case :
set $argv true
set argv true
case '['
set $argv test
set argv test
end
end

14
tests/checks/man.fish Normal file
View File

@@ -0,0 +1,14 @@
# RUN: %fish %s
# REQUIRES: command -v sphinx-build
# REQUIRES: command -v man
# REQUIRES: %fish -c 'status build-info' | grep '^Features:.*embed-data'
set -lx MANWIDTH 80
man abbr | head -n4
# CHECK: ABBR(1) fish-shell ABBR(1)
# CHECK: NAME
# CHECK: abbr - manage fish abbreviations
man : | head -n4
# CHECK: TRUE(1) fish-shell TRUE(1)
# CHECK: NAME
# CHECK: true - return a successful result