docs: def main():
      """ Main function when running as a program. """
      global args
      args = parse_args()
  
      if not args:
          return 1
  
      state = MyState(args)
  
      for path in args.paths:
          if os.path.isdir(path):
              walk_dir(path, args, state)
          else:
              safe_process_files(os.path.dirname(path), [os.path.basename(path)], args, state)
          if state.should_quit():
              break
      if state.failed_files:
          sys.stderr.write("error: %i/%i AEADs failed\n" % (len(state.failed_files), state.file_count))
          return 1
      if args.debug:
          sys.stderr.write("Successfully processed %i AEADs\n" % (state.file_count))