docs: def build_argparser():
      """Build argument parser for the CLI."""
      parser = ArgumentParser('Utility for managing MAR files')
      create_group = parser.add_argument_group("Create a MAR file")
      create_group.add_argument("-c", "--create", metavar="MARFILE", help="create MAR")
      create_group.add_argument("-V", "--productversion", dest="productversion",
                                help="product/version string")
      create_group.add_argument("-H", "--channel", dest="channel",
                                help="channel this MAR file is applicable to")
      create_group.add_argument("files", nargs=REMAINDER,
                                help="files to add to the MAR file")
  
      extract_group = parser.add_argument_group("Extract a MAR file")
      extract_group.add_argument("-x", "--extract", help="extract MAR", metavar="MARFILE")
  
      list_group = parser.add_argument_group("Print information on a MAR file")
      list_group.add_argument("-t", "--list", help="print out MAR contents",
                              metavar="MARFILE")
      list_group.add_argument("-T", "--list-detailed", metavar="MARFILE",
                              help="print out MAR contents including signatures")
  
      verify_group = parser.add_argument_group("Verify a MAR file")
      verify_group.add_argument("-v", "--verify", metavar="MARFILE",
                                help="verify the marfile")
  
      parser.add_argument("-j", "--bzip2", action="store_const", dest="compression",
                          const="bz2", help="compress/decompress members with BZ2")
      parser.add_argument("-J", "--xz", action="store_const", dest="compression",
                          const="xz", help="compress/decompress archive with XZ")
      parser.add_argument("--auto", action="store_const", dest="compression",
                          const="auto", help="automatically decompress contents")
  
      parser.add_argument("-k", "--keyfiles", dest="keyfiles", action='append',
                          help="sign/verify with given key(s)")
      parser.add_argument("-C", "--chdir", dest="chdir",
                          help="chdir to this directory before creating or "
                          "extracing; location of marfile isn't affected by "
                          "this option.")
      parser.add_argument("--verbose", dest="loglevel", action="store_const",
                          const=logging.DEBUG, default=logging.WARN,
                          help="increase logging verbosity")
      parser.add_argument('--version', action='version', version='mar version {}'.format(mardor.version_str))
  
      signing_group = parser.add_argument_group('Sign a MAR file')
      signing_group.add_argument('--hash', help='output hash for signing', choices=('sha1', 'sha384'))
      signing_group.add_argument('--asn1', help='format hash as an ASN1 DigestInfo block',
                                 default=False, action='store_true')
      signing_group.add_argument('--add-signature', help='inject signature', nargs=3,
                                 metavar=('input', 'output', 'signature'))
  
      return parser