nitc :: CmdAncestors
Retrieve all the ancestors (direct and indirect) of a MEntity.
nitc :: CmdAncestors :: _parents
Include direct parents in the ancestors listnitc :: CmdAncestors :: defaultinit
nitc :: CmdAncestors :: parents=
Include direct parents in the ancestors listnitc $ CmdAncestors :: SELF
Type of this instance, automatically specialized in every classnitc :: commands_http $ CmdAncestors :: http_init
Init the command from an HTTPRequestnitc :: commands_parser $ CmdAncestors :: parser_init
Initialize the command from the CommandParser datanitc :: html_commands $ CmdAncestors :: to_html
Render results as a HTML stringnitc :: md_commands $ CmdAncestors :: to_md
Render results as a Markdown stringnitc :: CmdInheritance :: _mainmodule
Mainmodule for class linearizationnitc :: CmdEntity :: _mentity_name
Name of the mentity this command is aboutnitc :: CmdAncestors :: _parents
Include direct parents in the ancestors listnitc :: CmdEntities :: _sorter
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: DocCommand :: cmd_filter
Return a new filter for that command execution.nitc :: CmdEntity :: defaultinit
nitc :: CmdInheritance :: defaultinit
nitc :: CmdEntityList :: defaultinit
nitc :: CmdList :: defaultinit
nitc :: CmdEntities :: defaultinit
nitc :: DocCommand :: defaultinit
nitc :: CmdAncestors :: defaultinit
core :: Object :: defaultinit
nitc :: DocCommand :: execute
nitc :: DocCommand :: filter=
ModelFilter to apply if anynitc :: DocCommand :: http_init
Init the command from an HTTPRequestcore :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
nitc :: CmdInheritance :: mainmodule=
Mainmodule for class linearizationnitc :: CmdEntity :: mentity_name
Name of the mentity this command is aboutnitc :: CmdEntity :: mentity_name=
Name of the mentity this command is aboutcore :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: CmdAncestors :: parents=
Include direct parents in the ancestors listnitc :: DocCommand :: parser_init
Initialize the command from the CommandParser datanitc :: CmdList :: print_list
nitc :: DocCommand :: to_json
Return a JSON Serializable representation ofself
results
# MEntity ancestors command
#
# Retrieve all the ancestors (direct and indirect) of a MEntity.
class CmdAncestors
super CmdInheritance
# Include direct parents in the ancestors list
#
# Default is `true`.
var parents = 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 ancestors = mentity.collect_ancestors(mainmodule, filter).to_a
if parents then
results = ancestors
return res
end
var parents = mentity.collect_parents(mainmodule, filter)
var mentities = new HashSet[MEntity]
for ancestor in ancestors do
if not parents.has(ancestor) then mentities.add ancestor
end
results = mentities.to_a
return res
end
end
src/doc/commands/commands_model.nit:127,1--159,3
redef class CmdAncestors
redef fun parser_init(mentity_name, options) do
var opt_parents = options.opt_bool("no-parents")
if opt_parents != null then parents = not opt_parents
return super
end
end
src/doc/commands/commands_parser.nit:340,1--346,3
redef class CmdAncestors
redef fun to_md do return super # FIXME lin
end
src/doc/templates/md_commands.nit:137,1--139,3
redef class CmdAncestors
redef fun execute(no_color) do
var full_name = mentity.as(not null).cs_full_name(no_color)
print_list("Ancestors for `{full_name}`:", results, no_color)
end
end
src/doc/term/term.nit:155,1--160,3
redef class CmdAncestors
redef fun to_html do return super # FIXME lin
end
src/doc/templates/html_commands.nit:164,1--166,3