2021-03-16 18:48:10 +00:00
|
|
|
# Load completions shared by various ssh tools like ssh, scp and sftp.
|
2006-02-15 02:22:28 +00:00
|
|
|
__fish_complete_ssh ssh
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2017-02-02 06:49:40 +00:00
|
|
|
#
|
|
|
|
# ssh specific completions
|
|
|
|
#
|
2009-02-01 23:18:05 +00:00
|
|
|
|
2021-03-16 18:48:10 +00:00
|
|
|
# Also retrieve `user@host` entries from history
|
|
|
|
function __ssh_history_completions
|
|
|
|
history --prefix ssh --max=100 | string replace -rf '.* ([A-Za-z0-9._:-]+@[A-Za-z0-9._:-]+).*' '$1'
|
|
|
|
end
|
2005-09-20 13:31:55 +00:00
|
|
|
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -d Remote -xa "(__fish_complete_user_at_hosts)"
|
|
|
|
complete -c ssh -d Remote -k -fa '(__ssh_history_completions)'
|
2017-02-02 06:49:40 +00:00
|
|
|
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -n 'test (__fish_number_of_cmd_args_wo_opts) -ge 2' -d "Command to run" -xa '(__fish_complete_subcommand --fcs-skip=2)'
|
2020-01-24 17:29:17 +00:00
|
|
|
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s a -d "Disables forwarding of the authentication agent"
|
|
|
|
complete -c ssh -s B -d "Bind to the address of that interface" -xa '(__fish_print_interfaces)'
|
|
|
|
complete -c ssh -s b -d "Local address to bind to" -xa '(__fish_print_addresses)'
|
|
|
|
complete -c ssh -s E -d "Append debug logs to log_file" -rF
|
|
|
|
complete -c ssh -s e -d "Escape character" -xa "\^ none"
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c ssh -s f -d "Go to background"
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s G -d "Print configuration after evaluating Host"
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c ssh -s g -d "Allow remote host to connect to local forwarded ports"
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s I -d "Specify the PKCS#11 library" -r
|
|
|
|
complete -c ssh -s K -d "Enables GSSAPI-based authentication"
|
|
|
|
complete -c ssh -s k -d "Disables forwarding of GSSAPI credentials"
|
|
|
|
complete -c ssh -s L -d "Specify local port forwarding" -x
|
2020-03-09 18:36:12 +00:00
|
|
|
complete -c ssh -s l -x -a "(__fish_complete_users)" -d User
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s M -d "Places the ssh client into master mode"
|
|
|
|
complete -c ssh -s m -d "MAC algorithm" -xa "(__fish_complete_list , __fish_ssh_macs)"
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c ssh -s N -d "Do not execute remote command"
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s n -d "Prevent reading from stdin"
|
|
|
|
complete -c ssh -s O -d "Control an active connection multiplexing master process" -x
|
|
|
|
complete -c ssh -s p -d Port -x
|
|
|
|
complete -c ssh -s Q -d "List supported algorithms" -xa "(ssh -Q help)"
|
|
|
|
complete -c ssh -s R -d "Specify remote/reverse port forwarding" -x
|
|
|
|
complete -c ssh -s S -d "Location of a control socket for connection sharing" -r
|
2020-03-09 18:36:12 +00:00
|
|
|
complete -c ssh -s s -d Subsystem
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c ssh -s T -d "Disable pseudo-tty allocation"
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s t -d "Force pseudo-tty allocation"
|
|
|
|
complete -c ssh -s V -d "Display version number"
|
|
|
|
complete -c ssh -s W -d "Forward stdin/stdout to host:port over secure channel" -x
|
|
|
|
complete -c ssh -s w -d "Requests tunnel device forwarding" -x
|
2017-02-02 06:49:40 +00:00
|
|
|
complete -c ssh -s X -d "Enable X11 forwarding"
|
2021-03-16 18:48:10 +00:00
|
|
|
complete -c ssh -s x -d "Disable X11 forwarding"
|
|
|
|
complete -c ssh -s Y -d "Enables trusted X11 forwarding"
|
|
|
|
complete -c ssh -s y -d "Send log information using syslog"
|