def parse_password_and_prompt_args(args):
  """Parse -P/--password optional arg (nargs=?, const=True). """
   # --P was provided without argument (True)
  if args.password is True:
    password = None
    prompt = True
  # --P was not provided (None), or provided with argument (<password>)
  else:
    password = args.password
    prompt = False

  return password, prompt