def _CommandsStart(unused_argv):
  """Main initialization.

  Calls __main__.main(), and then the command indicated by the first
  non-flag argument, or 'help' if no argument was given.  (The command
  to execute if no flag is given can be changed via SetDefaultCommand).

  Only non-flag arguments are passed to main(). If main does not call
  sys.exit, the return value of the command is used as the exit status.
  """
  # The following is supposed to return after registering additional commands
  try:
    sys.modules['__main__'].main(GetCommandArgv())
  # If sys.exit was called, return with error code.
  except __HOLE__, e:
    sys.exit(e.code)
  except Exception, error:
    traceback.print_exc()  # Print a backtrace to stderr.
    ShortHelpAndExit('\nFATAL error in main: %s' % error)

  if len(GetCommandArgv()) > 1:
    command = GetCommand(command_required=True)
  else:
    command = GetCommandByName(_cmd_default)
    if command is None:
      ShortHelpAndExit("FATAL Command '%s' unknown" % _cmd_default)
  sys.exit(command.CommandRun(GetCommandArgv()))
dataset/ETHPy150Open google/google-apputils/google/apputils/appcommands.py/_CommandsStart