def main():
  io_loop = ioloop.IOLoop.current()
  options.parse_command_line()

  def _OnException(type, value, traceback):
    logging.error('failed %s' % options.options.secrets_mode, exc_info=(type, value, traceback))
    io_loop.stop()
    sys.exit(1)

  with util.ExceptionBarrier(_OnException):
    if options.options.secrets_mode == 'list_secrets':
      _ListSecrets(io_loop)
    elif options.options.secrets_mode == 'get_secret':
      _GetSecret(io_loop, options.options.secret)
    elif options.options.secrets_mode == 'put_secret':
      _PutSecret(io_loop, options.options.secret)
    elif options.options.secrets_mode == 'put_crypt_keyset':
      _PutCryptKeyset(io_loop, options.options.secret)
    elif options.options.secrets_mode == 'put_signing_keyset':
      _PutSigningKeyset(io_loop, options.options.secret)
    elif options.options.secrets_mode == 'encrypt_secrets':
      _EncryptSecrets(io_loop)
    else:
      raise Exception('unknown secrets_mode: %s' % options.options.secrets_mode)

  io_loop.start()
Mock s3 and test package url generation
dataset/ETHPy150Open viewfinderco/viewfinder/backend/base/secrets_tool.py/main--crossover with--dataset/ETHPy150Open mathcamp/pypicloud/tests/test_storage.py/TestS3Storage.test_get_url