parameters: (debugger, args, result, dict)
docstring: Change the working directory, or cd to ${HOME}.
      You can also issue 'cd -' to change to the previous working directory.
docstring_summary: Change the working directory, or cd to ${HOME}.
      You can also issue 'cd -' to change to the previous working directory.
docstring_tokens: Change the working directory or cd to $ { HOME } . You can also issue cd - to change to the previous working directory .
function: def chdir(debugger, args, result, dict):
      """Change the working directory, or cd to ${HOME}.
      You can also issue 'cd -' to change to the previous working directory."""
      new_dir = args.strip()
      if not new_dir:
          new_dir = os.path.expanduser('~')
      elif new_dir == '-':
          if not Holder.prev_dir():
              # Bad directory, not changing.
              print("bad directory, not changing")
              return
          else:
              new_dir = Holder.prev_dir()
  
      Holder.swap(os.getcwd())
      os.chdir(new_dir)
      print("Current working directory: %s" % os.getcwd())
function_tokens: def chdir ( debugger , args , result , dict ) : new_dir = args . strip ( ) if not new_dir : new_dir = os . path . expanduser ( '~' ) elif new_dir == '-' : if not Holder . prev_dir ( ) : # Bad directory, not changing. print ( "bad directory, not changing" ) return else : new_dir = Holder . prev_dir ( ) Holder . swap ( os . getcwd ( ) ) os . chdir ( new_dir ) print ( "Current working directory: %s" % os . getcwd ( ) )