'Saves the current config to a new profile.'

def _cmd_save_as(self, params):

    self_contained = False
    if (not params):
        om.out.console('Parameter    missing,    please    see    the    help:')
        self._cmd_help(['save_as'])
        return
    elif (len(params) == 1):
        profile_name = params[0]
    elif (len(params) == 2):
        profile_name = params[0]
        self_contained = params[1]
        if ('self-contained' != self_contained):
            om.out.console('Invalid    profile    save    flag,    please    see    the    help:')
            self._cmd_help(['save_as'])
            return
        else:
            self_contained = True
    else:
        om.out.console('Too    many    parameters,    please    see    the    help:')
        self._cmd_help(['save_as'])
        return
    try:
        Profile.is_valid_profile_name(profile_name)
    except BaseFrameworkException as bfe:
        om.out.console(('%s' % bfe))
        return
    description = 'Profile    generated    using    the    console    UI.'
    self._w3af.profiles.save_current_to_new_profile(profile_name, description, self_contained=self_contained)
    om.out.console('Profile    saved.')
