code: def main():
      """Main function"""
  
      parser = argparse.ArgumentParser(
          description="""Install themes for Pelican"""
      )
  
      excl = parser.add_mutually_exclusive_group()
      excl.add_argument(
          "-l",
          "--list",
          dest="action",
          action="store_const",
          const="list",
          help="Show the themes already installed and exit",
      )
      excl.add_argument(
          "-p",
          "--path",
          dest="action",
          action="store_const",
          const="path",
          help="Show the themes path and exit",
      )
      excl.add_argument(
          "-V",
          "--version",
          action="version",
          version=f"pelican-themes v{__version__}",
          help="Print the version of this script",
      )
  
      parser.add_argument(
          "-i",
          "--install",
          dest="to_install",
          nargs="+",
          metavar="theme path",
          help="The themes to install",
      )
      parser.add_argument(
          "-r",
          "--remove",
          dest="to_remove",
          nargs="+",
          metavar="theme name",
          help="The themes to remove",
      )
      parser.add_argument(
          "-U",
          "--upgrade",
          dest="to_upgrade",
          nargs="+",
          metavar="theme path",
          help="The themes to upgrade",
      )
      parser.add_argument(
          "-s",
          "--symlink",
          dest="to_symlink",
          nargs="+",
          metavar="theme path",
          help="Same as `--install', but create a symbolic link instead of "
          "copying the theme. Useful for theme development",
      )
      parser.add_argument(
          "-c",
          "--clean",
          dest="clean",
          action="store_true",
          help="Remove the broken symbolic links of the theme path",
      )
  
      parser.add_argument(
          "-v",
          "--verbose",
          dest="verbose",
          action="store_true",
          help="Verbose output",
      )
  
      args = parser.parse_args()
  
      to_install = args.to_install or args.to_upgrade
      to_sym = args.to_symlink or args.clean
  
      if args.action:
          if args.action == "list":
              list_themes(args.verbose)
          elif args.action == "path":
              print(_THEMES_PATH)
      elif to_install or args.to_remove or to_sym:
          if args.to_remove:
              if args.verbose:
                  print("Removing themes...")
  
              for i in args.to_remove:
                  remove(i, v=args.verbose)
  
          if args.to_install:
              if args.verbose:
                  print("Installing themes...")
  
              for i in args.to_install:
                  install(i, v=args.verbose)
  
          if args.to_upgrade:
              if args.verbose:
                  print("Upgrading themes...")
  
              for i in args.to_upgrade:
                  install(i, v=args.verbose, u=True)
  
          if args.to_symlink:
              if args.verbose:
                  print("Linking themes...")
  
              for i in args.to_symlink:
                  symlink(i, v=args.verbose)
  
          if args.clean:
              if args.verbose:
                  print("Cleaning the themes directory...")
  
              clean(v=args.verbose)
      else:
          print("No argument given... exiting.")
  
file_path: pelican/pelican/tools/pelican_themes.py
imports: import argparse
  import os
  import shutil
  import sys
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types