mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-02-16 23:02:45 +08:00
completions/scp: silence error on unexpected version
There seem to be versions of ssh (possibly not from OpenSSH) that don't print the version number in -V, so make sure not to pass an empty string as numeric arg to test. Fixes #10445
This commit is contained in:
parent
85b3dbbec0
commit
2e42d80dc9
|
@ -44,8 +44,7 @@ complete -c scp -d "Local Path" -n "not string match @ -- (commandline -ct)"
|
|||
|
||||
# Remote path
|
||||
# Get the list of remote files from the scp target.
|
||||
string match -rq 'OpenSSH(_for_Windows)?_(?<major>\d+)\.*' -- (ssh -V 2>&1)
|
||||
if test "$major" -ge 9
|
||||
if string match -rq 'OpenSSH(_for_Windows)?_(?<major>\d+)\.*' -- (ssh -V 2>&1) && test "$major" -ge 9
|
||||
complete -c scp -d "Remote Path" -f -n "commandline -ct | string match -e ':'" -a "
|
||||
(__scp_remote_target):( \
|
||||
command ssh (__scp2ssh_port_number) -o 'BatchMode yes' (__scp_remote_target) command\ ls\ -dp\ (__scp_remote_path_prefix)\* 2>/dev/null
|
||||
|
|
Loading…
Reference in New Issue
Block a user