code: def generate_cli_main_parser():
      
      parser = argparse.ArgumentParser(
          description='Create, Update, Delete, List DNS entries')
  
      parser.add_argument('--version', help='show the current version of lexicon',
                          action='version', version='%(prog)s {0}'
                          .format(discovery.lexicon_version()))
      parser.add_argument('--delegated', help='specify the delegated domain')
      parser.add_argument('--config-dir', default=os.getcwd(),
                          help='specify the directory where to search lexicon.yml and '
                               'lexicon_[provider].yml configuration files '
                               '(default: current directory).')
      subparsers = parser.add_subparsers(
          dest='provider_name', help='specify the DNS provider to use')
      subparsers.required = True
  
      for provider, available in discovery.find_providers().items():
          provider_module = importlib.import_module(
              'lexicon.providers.' + provider)
          provider_parser = getattr(provider_module, 'provider_parser')
  
          subparser = subparsers.add_parser(provider, help='{0} provider'.format(provider),
                                            parents=[generate_base_provider_parser()])
          provider_parser(subparser)
  
          if not available:
              subparser.epilog = ('WARNING: some required dependencies for this provider are not '
                                  'installed. Please install lexicon[{0}] first before using it.'
                                  .format(provider))
  
      return parser
docs: Using all providers available, generate a parser that will be used by Lexicon CLI