Skip to content

Commit a710a31

Browse files
committed
refactor(ssh): remove ssh from scp xfunc names
xfuncs being part of the API, we don't want to expose the implementation detail that the `scp` completion currently resides in the `ssh` file.
1 parent f1d7545 commit a710a31

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

completions/rsync

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ _comp_cmd_rsync()
8181
break
8282
fi
8383
done
84-
[[ $shell == ssh ]] && _comp_xfunc ssh scp_remote_files
84+
[[ $shell == ssh ]] && _comp_xfunc scp remote_files
8585
;;
8686
*)
8787
_known_hosts_real -c -a -- "$cur"
88-
_comp_xfunc ssh scp_local_files
88+
_comp_xfunc scp local_files
8989
;;
9090
esac
9191
} &&

completions/ssh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ _comp_cmd_scp__path_esc='[][(){}<>"'"'"',:;^&!$=?`\\|[:space:]]'
435435
# only. Returns paths escaped with three backslashes.
436436
# @since 2.12
437437
# shellcheck disable=SC2120
438-
_comp_xfunc_ssh_scp_remote_files()
438+
_comp_xfunc_scp_remote_files()
439439
{
440440
# remove backslash escape from the first colon
441441
cur=${cur/\\:/:}
@@ -471,14 +471,14 @@ _comp_xfunc_ssh_scp_remote_files()
471471
_comp_split -la COMPREPLY "$files"
472472
}
473473

474-
_comp_deprecate_func 2.12 _scp_remote_files _comp_xfunc_ssh_scp_remote_files
474+
_comp_deprecate_func 2.12 _scp_remote_files _comp_xfunc_scp_remote_files
475475

476476
# This approach is used instead of _comp_compgen_filedir to get a space
477477
# appended after local file/dir completions, and -o nospace retained for
478478
# others. If first arg is -d, complete on directory names only. The next arg
479479
# is an optional prefix to add to returned completions.
480480
# @since 2.12
481-
_comp_xfunc_ssh_scp_local_files()
481+
_comp_xfunc_scp_local_files()
482482
{
483483
local IFS=$'\n'
484484

@@ -502,7 +502,7 @@ _comp_xfunc_ssh_scp_local_files()
502502
fi
503503
}
504504

505-
_comp_deprecate_func 2.12 _scp_local_files _comp_xfunc_ssh_scp_local_files
505+
_comp_deprecate_func 2.12 _scp_local_files _comp_xfunc_scp_local_files
506506

507507
# scp(1) completion
508508
#
@@ -566,7 +566,7 @@ _comp_cmd_scp()
566566
case $cur in
567567
!(*:*)/* | [.~]*) ;; # looks like a path
568568
*:*)
569-
_comp_xfunc_ssh_scp_remote_files
569+
_comp_xfunc_scp_remote_files
570570
return
571571
;;
572572
esac
@@ -592,7 +592,7 @@ _comp_cmd_scp()
592592
esac
593593
fi
594594

595-
_comp_xfunc_ssh_scp_local_files "${prefix-}"
595+
_comp_xfunc_scp_local_files "${prefix-}"
596596
} &&
597597
complete -F _comp_cmd_scp -o nospace scp
598598

completions/sshfs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ _comp_cmd_sshfs()
88
_expand || return
99

1010
if [[ $cur == *:* ]]; then
11-
_comp_xfunc ssh scp_remote_files -d
11+
_comp_xfunc scp remote_files -d
1212
# unlike scp and rsync, sshfs works with 1 backslash instead of 3
1313
COMPREPLY=("${COMPREPLY[@]//\\\\\\/\\}")
1414
return
1515
fi
1616

1717
[[ $cur == @(*/|[.~])* ]] || _known_hosts_real -c -a -- "$cur"
1818

19-
_comp_xfunc ssh scp_local_files -d
19+
_comp_xfunc scp local_files -d
2020
} &&
2121
complete -F _comp_cmd_sshfs -o nospace sshfs
2222

0 commit comments

Comments
 (0)