nitc :: CmdDescendants :: defaultinit
# MEntity descendants command
class CmdDescendants
super CmdInheritance
# Include direct children in the descendants list
#
# Default is `true`.
var children = true is optional, writable
redef fun init_results do
if results != null then return new CmdSuccess
var res = super
if not res isa CmdSuccess then return res
var mentity = self.mentity.as(not null)
var descendants = mentity.collect_descendants(mainmodule, filter).to_a
if children then
results = descendants
return res
end
var children = mentity.collect_children(mainmodule, filter)
var mentities = new HashSet[MEntity]
for descendant in descendants do
if not children.has(descendant) then mentities.add descendant
end
results = mentities.to_a
return res
end
end
src/doc/commands/commands_model.nit:193,1--223,3