Update p4.fish

add `--` for the string match command, so that if the `$line` has any `-`'s in it will be ignored
This commit is contained in:
Shaik Azhar Madar 2024-08-02 09:53:24 +05:30 committed by Mahmoud Al-Qudsi
parent c3c8327610
commit b31b77cf83

View File

@ -45,7 +45,7 @@ function __fish_print_p4_changelists -d "Reformat output from `p4 changes` to si
continue
end
# see output format ^^^
set -l change_match (string match -ar '^Change ([0-9]+) on [0-9/]+ by (\S+).*$' $line)
set -l change_match (string match -ar '^Change ([0-9]+) on [0-9/]+ by (\S+).*$' -- $line)
if test -n "$change_match"
if test -n "$result"
echo $result
@ -56,7 +56,7 @@ function __fish_print_p4_changelists -d "Reformat output from `p4 changes` to si
set result $result $change_match[3]:
end
else
set result $result $line
set -a result $line
end
end