mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 15:37:59 +08:00
Make less version check compatible with older Fish
This commit is contained in:
parent
2debc68ee9
commit
0d8ffa8f87
|
@ -121,7 +121,7 @@ function __fish_print_help --description "Print help message for the specified f
|
|||
# similar to man, but add -F to quit paging when the help output is brief (#6227)
|
||||
# Also set -X for less < v530, see #8157.
|
||||
set -l lessopts isRF
|
||||
if test "$(less --version | string match -rg 'less (\d+)')" -lt 530 2>/dev/null
|
||||
if test (less --version | string match -r 'less (\d+)')[2] -lt 530 2>/dev/null
|
||||
set lessopts "$lessopts"X
|
||||
end
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ function history --description "display or manipulate interactive command histor
|
|||
if not set -qx LESS
|
||||
set -x LESS --quit-if-one-screen
|
||||
# Also set --no-init for less < v530, see #8157.
|
||||
if test "$(less --version | string match -rg 'less (\d+)')" -lt 530 2>/dev/null
|
||||
if test (less --version | string match -r 'less (\d+)')[2] -lt 530 2>/dev/null
|
||||
set -x LESS $LESS --no-init
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user