nitc :: CmdManFile
mentity
nitc :: CmdManFile :: defaultinit
nitc $ CmdManFile :: SELF
Type of this instance, automatically specialized in every classnitc :: CmdEntity :: _mentity_name
Name of the mentity this command is aboutcore :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: DocCommand :: cmd_filter
Return a new filter for that command execution.core :: Object :: defaultinit
nitc :: CmdEntity :: defaultinit
nitc :: CmdManFile :: defaultinit
nitc :: DocCommand :: 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 :: 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 :: DocCommand :: parser_init
Initialize the command from the CommandParser datanitc :: DocCommand :: to_json
Return a JSON Serializable representation ofself
results
# Cmd that finds the man file related to an `mentity`
class CmdManFile
super CmdEntity
# Man file
var file: nullable String = null
redef fun init_command do
var res = super
if not res isa CmdSuccess then return res
var mentity = self.mentity.as(not null)
var mpackage = null
if mentity isa MPackage then
mpackage = mentity
else if mentity isa MGroup then
mpackage = mentity.mpackage
else if mentity isa MModule then
mpackage = mentity.mpackage
end
if mpackage == null then return new WarningNoManFile(mentity)
var source_file = mpackage.location.file
if source_file == null then return new WarningNoManFile(mentity)
var man_dir = source_file.filename / "man"
if not man_dir.file_exists then return new WarningNoManFile(mentity)
var man_file = null
for file in man_dir.files do
if not file.has_prefix(mentity.name) then continue
man_file = man_dir / file
end
if man_file == null then return new WarningNoManFile(mentity)
self.file = man_file
return res
end
end
src/doc/commands/commands_main.nit:197,1--237,3