code: def main() -> None:
      
      main_only_quicksetup_rootlogger(level=logging.DEBUG)
      parser = argparse.ArgumentParser(
          formatter_class=argparse.ArgumentDefaultsHelpFormatter
      )
      parser.add_argument(
          "input_file",
          help="Input PDF (which is not modified by this program)")
      parser.add_argument(
          "output_file",
          help="Output PDF")
      parser.add_argument(
          "--slice_horiz", type=int, default=1,
          help="Slice the input PDF first into this many parts horizontally")
      parser.add_argument(
          "--slice_vert", type=int, default=1,
          help="Slice the input PDF first into this many parts vertically")
      parser.add_argument(
          "--longedge", action="store_true",
          help="Create PDF for long-edge duplex printing, not short edge")
      parser.add_argument(
          "--overwrite", action="store_true",
          help="Allow overwriting of an existing output file")
      parser.add_argument(
          "--unittest", action="store_true",
          help="Run unit tests and exit (you must pass dummy values for "
               "input/output files to use these tests)")
      # ... because requiring dummy input/output filenames for unit testing
      # is less confusing for the majority of users than showing syntax in
      # which they are optional!
      args = parser.parse_args()
  
      if args.unittest:
          log.warning("Performing unit tests")
          # unittest.main() doesn't play nicely with argparse; they both
          # use sys.argv by default (and we end up with what looks like garbage
          # from the argparse help facility); but this works:
          unittest.main(argv=[sys.argv[0]])
          sys.exit(EXIT_SUCCESS)
  
      success = convert_to_foldable(
          input_filename=os.path.abspath(args.input_file),
          output_filename=os.path.abspath(args.output_file),
          slice_horiz=args.slice_horiz,
          slice_vert=args.slice_vert,
          overwrite=args.overwrite,
          longedge=args.longedge
      )
      sys.exit(EXIT_SUCCESS if success else EXIT_FAILURE)
docs: Command-line processor. See ``--help`` for details.