1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
# (C) 2011-2013 magicant
# Completion script for the "ssh-keygen" command.
# Supports OpenSSH 6.2.
function completion/ssh-keygen {
typeset OPTIONS ARGOPT PREFIX
OPTIONS=( #>#
"A; create all types of host keys"
"a:; specify the number of primality tests performed (with -T)"
"B; print the bubblebabble digest"
"b:; specify the number of bits of the key being created"
"C:; specify the comment of the key"
"c; change the comment of RSA1 private/public keys"
"D:; download the RSA public keys from the specified PKCS#11 library"
"e; print the key in the portable format"
"F:; specify the host name to search the known hosts file for"
"f:; specify the key file to operate on"
"G:; specify the file to save candidate primes"
"g; use generic DNS format (with -r)"
"H; hash the known hosts file"
"h; create a host certificate when signing a key"
"I:; specify the key identity used when signing a key"
"i; print the key in the non-portable format"
"L; print the contents of a certificate"
"l; print the fingerprint of the public key file"
"M:; specify the memory size in megabytes used when generating candidate moduli"
"m:; specify the key format (with -e or -i)"
"N:; specify the new passphrase"
"n:; specify principals included in a certificate when signing a key"
"O:; specify a certificate option when signing a key"
"P:; specify the (current) passphrase"
"p; change the passphrase of the private key"
"q; make ssh-keygen quiet"
"R:; specify the host name to remove from the known hosts file"
"r:; print the SSHFP fingerprint resource record of the specified host name"
"S:; specify the start point for generating candidate moduli"
"s:; specify the CA key file to sign the public key with"
"T:; test DH group exchange candidate primes"
"t:; specify the key type"
"V:; specify the validity interval of the signed certificate"
"v; print debugging messages"
"W:; specify the DH generator"
"y; extract the public key from the private key"
"z:; specify the serial number of the certificate"
) #<#
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
([abMSVz])
;;
([FR])
complete -P "$PREFIX" -h
;;
(m) #>>#
complete -P "$PREFIX" -D 'SSH2 public or private key' RFC4716
complete -P "$PREFIX" -D 'PEM PKCS8 public key' PKCS8
complete -P "$PREFIX" -D 'PEM public key' PEM
;; #<<#
(O)
#TODO
;;
(t) #>>#
complete -P "$PREFIX" -D 'RSA, protocol version 1' rsa1
complete -P "$PREFIX" -D 'RSA, protocol version 2' rsa
complete -P "$PREFIX" -D 'DSA, protocol version 2' dsa
;; #<<#
(W)
complete 2 3 5
;;
(*)
complete -P "$PREFIX" -f
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
|