code: def main():
      
      args = getArguments()
      try:
          if args.action == 'init':
              # Ask for init
              while True:
                  print 'Initialize the path [%s] will cause any files or dirs be removed, continue?[y/n]' % args.basePath,
                  text = raw_input()
                  if text.lower() == 'n':
                      print 'Will not initialize the path, exit'
                      return 1
                  elif text.lower() == 'y':
                      # Initialize
                      manager = CertificateManager(args.basePath)
                      manager.init()
                      return 0
                  else:
                      print 'Invalid input'
          elif args.action == 'verify':
              # Verify the certificate
              manager = CertificateManager(args.basePath)
              manager.verifyCertificate(args.name)
              return 0
          elif args.action == 'createRootCert':
              # Create the root cert
              manager = CertificateManager(args.basePath)
              manager.createRootCertificate(args.noPass, int(args.keyLength))
              return 0
          elif args.action == 'createServerCert':
              # Create the server cert
              manager = CertificateManager(args.basePath)
              manager.createServerCertificate(args.name, not args.usePass, args.keyLength, args.days)
              return 0
          elif args.action == 'createClientCert':
              # Create the client cert
              manager = CertificateManager(args.basePath)
              manager.createClientCertificate(args.name, not args.usePass, args.keyLength, args.days)
              return 0
          else:
              logger.error('Unknown argument action [%s]', args.action)
              return 1
      except ValueError as error:
          logger.error(error.message)
          return 1
      except KeyboardInterrupt:
          logger.error('User interrupted')
          return 1
      except:
          logger.exception('Unhandled exception occurred')
          return 1
docs: The main entry