def generate_ssh_key_parser(subparsers, name, default_key_size=2048,
    default_key_type='rsa'):
    """
    Create an argparse sub-command with `name` attached to `subparsers`.
    """
    generate_ssh_key = subparsers.add_parser(name, help=
        'Create a SSH public and private key pair.')
    generate_ssh_key.add_argument('--key-file', metavar='FILE', help=
        'Store the keys pair in FILE and FILE.pub. Default id_TYPE.')
    generate_ssh_key.add_argument('--key-size', type=int, metavar='SIZE',
        default=default_key_size, help=
        'Generate a RSA or DSA key of size SIZE. Default %(default)s')
    generate_ssh_key.add_argument('--key-type', metavar='[rsa|dsa]',
        default=default_key_type, help=
        'Generate a DSA or RSA key. Default %(default)s.')
    generate_ssh_key.add_argument('--key-comment', metavar='COMMENT_TEXT',
        help='Generate the public key using this comment. Default no comment.')
    generate_ssh_key.add_argument('--key-skip', action='store_true',
        default=False, help=
        'Do not create a new key if a key file already exists.')
    return generate_ssh_key
