docs: def main():
      """
      Run the main CLI program.
  
      Initializes the stack, parses command line arguments, and fires requested
      logic.
      """
      plugins = DefaultPluginManager()
      plugins.load_plugins()
  
      parser, _ = create_argparser()
      # add the updater protocol options to the CLI:
      for kls in updater_classes():
          kls.register_arguments(parser)
  
      for kls in detector_classes():
          kls.register_arguments(parser)
  
      # add the plugin options to the CLI:
      from os import environ
      plugins.options(parser, environ)
  
      args = parser.parse_args()
  
      if args.debug:
          args.verbose_count = 5  # some high number
  
      log_level = max(int(logging.WARNING / 10) - args.verbose_count, 0) * 10
      # print(log_level)
      logging.basicConfig(level=log_level, format="%(levelname)s %(message)s")
      # logging.debug("args %r", args)
  
      if args.version:
          from . import __version__
          print("dyndnsc %s" % __version__)  # noqa
          return 0
  
      # silence 'requests' logging
      requests_log = logging.getLogger("requests")
      requests_log.setLevel(logging.WARNING)
  
      logging.debug(parser)
      cfg = get_configuration(args.config)
  
      if args.listpresets:
          list_presets(cfg)
          return 0
  
      if args.config:
          collected_configs = collect_config(cfg)
      else:
          parsed_args = parse_cmdline_args(args, updater_classes().union(detector_classes()))
          logging.debug("parsed_args %r", parsed_args)
  
          collected_configs = {
              "cmdline": {
                  "interval": int(args.sleeptime)
              }
          }
          collected_configs["cmdline"].update(parsed_args)
  
      plugins.configure(args)
      plugins.initialize()
  
      logging.debug("collected_configs: %r", collected_configs)
      dyndnsclients = []
      for thisconfig in collected_configs:
          logging.debug("Initializing client for '%s'", thisconfig)
          # done with options, bring on the dancing girls
          dyndnsclient = getDynDnsClientForConfig(
              collected_configs[thisconfig], plugins=plugins)
          if dyndnsclient is None:
              return 1
          # do an initial synchronization, before going into endless loop:
          dyndnsclient.sync()
          dyndnsclients.append(dyndnsclient)
  
      run_forever_callable = partial(run_forever, dyndnsclients)
  
      if args.daemon:
          import daemonocle
          daemon = daemonocle.Daemon(worker=run_forever_callable)
          daemon.do_action("start")
          args.loop = True
  
      if args.loop:
          run_forever_callable()
  
      return 0