(self)
Add --with-X/--without-X options based on optional features
Add --with-X/--without-X options based on optional features
Add -- with - X / -- without - X options based on optional features
def _set_global_opts_from_features(self):
        """Add --with-X/--without-X options based on optional features"""

        go = []
        no = self.negative_opt.copy()

        for name, feature in self.features.items():
            self._set_feature(name, None)
            feature.validate(self)

            if feature.optional:
                descr = feature.description
                incdef = ' (default)'
                excdef = ''
                if not feature.include_by_default():
                    excdef, incdef = incdef, excdef

                new = (
                    ('with-' + name, None, 'include ' + descr + incdef),
                    ('without-' + name, None, 'exclude ' + descr + excdef),
                )
                go.extend(new)
                no['without-' + name] = 'with-' + name

        self.global_options = self.feature_options = go + self.global_options
        self.negative_opt = self.feature_negopt = no
def _set_global_opts_from_features ( self ) : go = [ ] no = self . negative_opt . copy ( ) for name , feature in self . features . items ( ) : self . _set_feature ( name , None ) feature . validate ( self ) if feature . optional : descr = feature . description incdef = ' (default)' excdef = '' if not feature . include_by_default ( ) : excdef , incdef = incdef , excdef new = ( ( 'with-' + name , None , 'include ' + descr + incdef ) , ( 'without-' + name , None , 'exclude ' + descr + excdef ) , ) go . extend ( new ) no [ 'without-' + name ] = 'with-' + name self . global_options = self . feature_options = go + self . global_options self . negative_opt = self . feature_negopt = no