Property definitions

nitc $ CmdCatalogContributing :: defaultinit
# Retrieve the packages contributed by a person
class CmdCatalogContributing
	super CmdCatalogPerson
	super CmdCatalogPackages

	autoinit(model, catalog, filter, person, person_name, limit, page, count, max)

	# Include maintained packages?
	#
	# Default is `false`.
	var maintaining = false is optional, writable

	# FIXME linearization
	redef fun init_command do return super

	redef fun init_results do
		if results != null then return new CmdSuccess

		var res = super
		if not res isa CmdSuccess then return res
		var person = self.person.as(not null)

		if not catalog.contrib2proj.has_key(person) then return res

		var maint2proj = null
		if catalog.maint2proj.has_key(person) then
			maint2proj = catalog.maint2proj[person]
		end

		var results = new Array[MPackage]
		for mpackage in catalog.contrib2proj[person] do
			if not maintaining and maint2proj != null and maint2proj.has(mpackage) then continue
			results.add mpackage
		end
		self.results = results
		return res
	end
end
src/doc/commands/commands_catalog.nit:309,1--346,3