Property definitions

nitc $ CmdFeatures :: defaultinit
# MEntity feature list
#
# Mostly a list of mentities defined in `mentity`.
class CmdFeatures
	super CmdEntityList

	# Same as `CmdEntity::init_mentity`
	#
	# Plus `WarningNoFeatures` if no features are found for `mentity`.
	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 mentities = new Array[MEntity]
		if mentity isa MPackage then
			mentities.add_all mentity.collect_mgroups(filter)
			mentities.add_all mentity.collect_mmodules(filter)
		else if mentity isa MGroup then
			mentities.add_all mentity.collect_mgroups(filter)
			mentities.add_all mentity.collect_mmodules(filter)
		else if mentity isa MModule then
			mentities.add_all mentity.collect_local_mclassdefs(filter)
		else if mentity isa MClass then
			mentities.add_all mentity.collect_intro_mproperties(filter)
			mentities.add_all mentity.collect_redef_mpropdefs(filter)
		else if mentity isa MClassDef then
			mentities.add_all mentity.collect_intro_mpropdefs(filter)
			mentities.add_all mentity.collect_redef_mpropdefs(filter)
		else if mentity isa MProperty then
			mentities.add_all mentity.collect_mpropdefs(filter)
		else
			return new WarningNoFeatures(mentity)
		end
		self.results = mentities
		return res
	end
end
src/doc/commands/commands_model.nit:290,1--329,3