Append password switch to commandline.
760359
def add_password_arg(cmd, psw, ___required=False):
    
    if UNRAR_TOOL == ALT_TOOL:
        return
    if psw is not None:
        cmd.append('-p' + psw)
    else:
        cmd.append('-p-')
179604
def write(self, *args):
        """"""
        ConfigParser.write(self, *args)
        if self.keyring_available:
            for key, thing in self._unsaved.items():
                action = thing[0]
                value = thing[1]
                if action == 'set':
                    keyring.set_password(self.keyring_name, key, value)
                elif action == 'delete':
                    try:
                        keyring.delete_password(self.keyring_name, key)
                    except:
                        pass
        self._unsaved = {}
393252
def del_password(name, root=None):
    '''
    
    '''
    cmd = ['passwd']
    if root is not None:
        cmd.extend(('-R', root))
    cmd.extend(('-d', name))

    __salt__['cmd.run'](cmd, python_shell=False, output_loglevel='quiet')
    uinfo = info(name, root=root)
    return not uinfo['passwd'] and uinfo['name'] == name
1177014
def passthrough_repl(self, inputstring, **kwargs):
        """"""
        out = []
        index = None
        for c in append_it(inputstring, None):
            try:

                if index is not None:
                    if c is not None and c in nums:
                        index += c
                    elif c == unwrapper and index:
                        ref = self.get_ref("passthrough", index)
                        out.append(ref)
                        index = None
                    elif c != "\\" or index:
                        out.append("\\" + index)
                        if c is not None:
                            out.append(c)
                        index = None
                elif c is not None:
                    if c == "\\":
                        index = ""
                    else:
                        out.append(c)

            except CoconutInternalException as err:
                complain(err)
                if index is not None:
                    out.append(index)
                    index = None
                out.append(c)

        return "".join(out)
793760
def enable(
        self,
        cmd="enable",
        pattern="password",
        re_flags=re.IGNORECASE,
        default_username="manager",
    ):
        """"""
        if self.check_enable_mode():
            return ""
        output = self.send_command_timing(cmd)
        if (
            "username" in output.lower()
            or "login name" in output.lower()
            or "user name" in output.lower()
        ):
            output += self.send_command_timing(default_username)
        if "password" in output.lower():
            output += self.send_command_timing(self.secret)
        log.debug("{}".format(output))
        self.clear_buffer()
        return output
210166
def password_prompt(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    if not value:
        if 'password_stdin' in ctx.params:
            with click.open_file('-') as fp:
                value = fp.read().strip('\n')
        else:
            value = click.prompt('Password', hide_input=True)

    click.echo(value)
    return value
1137804
def get_tty_password(confirm):
    """"""
    LOG.debug("Reading password from TTY")
    new_password = getpass('Enter Password: ', stream=sys.stderr)
    if not new_password:
        raise aomi.exceptions.AomiCommand("Must specify a password")

    if not confirm:
        return new_password

    confirm_password = getpass('Again, Please: ', stream=sys.stderr)
    if confirm_password != new_password:
        raise aomi.exceptions.AomiCommand("Passwords do not match")

    return new_password
1060256
def cli(env, identifier, label, note):
    """"""

    mgr = SoftLayer.SshKeyManager(env.client)

    key_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'SshKey')

    if not mgr.edit_key(key_id, label=label, notes=note):
        raise exceptions.CLIAbort('Failed to edit SSH key')
360794
public String promptForPassword(String arg) {

		char[] pass1 = console.readPassword(CommandUtils.getMessage("password.enterText", arg) + " ");		
		char[] pass2 = console.readPassword(CommandUtils.getMessage("password.reenterText", arg) + " ");
		
		if (pass1 == null && pass2 == null) {
            throw new IllegalArgumentException("Unable to read either entry. Aborting prompt.");
        }
		if (pass1 == null || pass2 == null) {
            stdout.println(CommandUtils.getMessage("password.readError"));
            return promptForPassword(arg);
        }
				
		String password1 =  String.valueOf(pass1);
		String password2 =  String.valueOf(pass2);
		
       if (password1.equals(password2)) {
            return password1;
        } else {
            stdout.println(CommandUtils.getMessage("password.entriesDidNotMatch"));
            return promptForPassword(arg);
        }		
	}
502775
def make(parser):
    """"""
    s = parser.add_subparsers(
        title='commands',
        metavar='COMMAND',
        help='description',
        )

    def gen_pass_f(args):
        gen_pass()
    gen_pass_parser = s.add_parser('gen-pass', help='generate the password')
    gen_pass_parser.set_defaults(func=gen_pass_f)

    def cmd_f(args):
        cmd(args.user, args.hosts.split(','), args.key_filename, args.password, args.run)
    cmd_parser = s.add_parser('cmd', help='run command line on the target host')
    cmd_parser.add_argument('--run', help='the command running on the remote node', action='store', default=None, dest='run')
    cmd_parser.set_defaults(func=cmd_f)
361471
def set_password(self, service, username, password):
        
        service = escape_for_ini(service)
        username = escape_for_ini(username)

        # ensure the file exists
        self._ensure_file_path()

        # load the keyring from the disk
        config = configparser.RawConfigParser()
        config.read(self.file_path)

        # update the keyring with the password
        if not config.has_section(service):
            config.add_section(service)
        config.set(service, username, password)

        # save the keyring back to the file
        config_file = codecs.open(self.file_path, 'w', 'utf-8')
        try:
            config.write(config_file)
        finally:
            config_file.close()
905750
def AddCredentialOptions(self, argument_group):
    
    argument_group.add_argument(
        '--credential', action='append', default=[], type=str,
        dest='credentials', metavar='TYPE:DATA', help=(
            'Define a credentials that can be used to unlock encrypted '
            'volumes e.g. BitLocker. The credential is defined as type:data '
            'e.g. "password:BDE-test". Supported credential types are: '
            '{0:s}. Binary key data is expected to be passed in BASE-16 '
            'encoding (hexadecimal). WARNING credentials passed via command '
            'line arguments can end up in logs, so use this option with '
            'care.').format(', '.join(self._SUPPORTED_CREDENTIAL_TYPES)))
1113480
def append (self, cmd, delay=0.000, attrs=None):
    """"""
    self.lines.append( SeqCmd(cmd, delay, attrs) )
1267864
def unlock(password)
      cmd = Xcode::Shell::Command.new "security"
      cmd << "unlock-keychain"
      cmd << "-p #{password}"
      cmd << "\"#{@path}\""
      cmd.execute
    end
750857
def a_send_password(password, ctx):
    
    if password:
        ctx.ctrl.send_command(password, password=True)
        return True
    else:
        ctx.ctrl.disconnect()
        raise ConnectionAuthenticationError("Password not provided", ctx.ctrl.hostname)
586514
def press_enter(multiple=False, silent=False):
    """"""

    def f():
        try:
            while True:
                if silent:
                    yield input()
                else:
                    sys.stderr.write("<press enter> ")
                    sys.stderr.flush()
                    yield input()
                if not multiple:
                    break
        except (EOFError, KeyboardInterrupt):
            # User Ctrl+D or Ctrl+C'd
            if not silent:
                # Prevents the user's terminal getting clobbered
                sys.stderr.write("\n")
                sys.stderr.flush()
            return

    return f
1251017
def acquire_password(args)
      if args[:pw] == :prompt
        JSS.prompt_for_password "Enter the password for JSS user #{args[:user]}@#{args[:server]}:"
      elsif args[:pw].is_a?(Symbol) && args[:pw].to_s.start_with?('stdin')
        args[:pw].to_s =~ /^stdin(\d+)$/
        line = Regexp.last_match(1)
        line ||= 1
        JSS.stdin line
      else
        args[:pw]
      end
    end