// For historical reasons we allow --leaf-scope-flag-name anywhere on the cmd line,
// as an alternative to ... leaf.scope --flag-name. This makes the transition to
// the new options system easier, as old-style flags will still work.
self._known_scoping_prefixes = {}
// Note: This algorithm for finding the lead scopes relies on the fact that enclosing
// scopes are earlier than enclosed scopes in the list.
leaf_scopes = set()
for scope in known_scopes:
if scope:
outer_scope, _, _ = scope.rpartition(".")
if outer_scope in leaf_scopes:
leaf_scopes.discard(outer_scope)
leaf_scopes.add(scope)
for scope in leaf_scopes:
self._known_scoping_prefixes["{0}-".format(scope.replace(".", "-"))] = scope
@property
def is_help(self):
return self._is_help