def add(name, connection_uri, id_file="", o=[], config=None):
    """
    Adds a new entry to sshconfig.
    """
    storm_ = get_storm_instance(config)

    try:

        # validate name
        if '@' in name:
            raise ValueError('invalid value: "@" cannot be used in name.')

        user, host, port = parse(
            connection_uri,
            user=get_default("user", storm_.defaults),
            port=get_default("port", storm_.defaults)
        )

        storm_.add_entry(name, host, user, port, id_file, o)

        print(
            get_formatted_message(
                '{0} added to your ssh config. you can connect '
                'it by typing "ssh {0}".'.format(name),
            'success')
        )

    except ValueError as error:
        print(get_formatted_message(error, 'error'), file=sys.stderr)
        sys.exit(1)
def add ( name , connection_uri , id_file = "" , o = [ ] , config = None ) : storm_ = get_storm_instance ( config ) try : if '@' in name : raise ValueError ( 'invalid value: "@" cannot be used in name.' ) user , host , port = parse ( connection_uri , user = get_default ( "user" , storm_ . defaults ) , port = get_default ( "port" , storm_ . defaults ) ) storm_ . add_entry ( name , host , user , port , id_file , o ) print ( get_formatted_message ( '{0} added to your ssh config. you can connect ' 'it by typing "ssh {0}".' . format ( name ) , 'success' ) ) except ValueError as error : print ( get_formatted_message ( error , 'error' ) , file = sys . stderr ) sys . exit ( 1 )
Adds a new entry to sshconfig.