code: def make_parser_with_config_adder(parser, config):
      
  
      def internal(arg, **kwargs):
          invert = {
              'store_true':'store_false',
              'store_false':'store_true',
          }
          if arg.startswith('--no-'):
              key = arg[5:]
          else:
              key = arg[2:]
          if 'default' in kwargs:
              if key in config:
                  kwargs['default'] = config[key]
                  del config[key]
          action = kwargs.get('action')
          if action in invert:
              exclusive_grp = parser.add_mutually_exclusive_group()
              exclusive_grp.add_argument(arg, **kwargs)
              kwargs['action'] = invert[action]
              kwargs['help'] = 'Inverse of "%s"' % arg
              if arg.startswith('--no-'):
                  arg = '--%s' % arg[5:]
              else:
                  arg = '--no-%s' % arg[2:]
              exclusive_grp.add_argument(arg, **kwargs)
          else:
              parser.add_argument(arg, **kwargs)
  
      return internal
docs: factory function for a smarter parser:
  
      return an utility function that pull default from the config as well.
  
      Pull the default for parser not only from the ``default`` kwarg,
      but also if an identical value is find in ``config`` where leading
      ``--`` or ``--no`` is removed.
  
      If the option is a boolean flag, automatically register an opposite,
      exclusive option by prepending or removing the `--no-`. This is useful
      to overwrite config in ``.travis.yml``
  
      Mutate the config object and remove know keys in order to detect unused
      options afterwoard.