Redefined classes

redef class CmdAncestors

nitc :: term $ CmdAncestors

MEntity ancestors command
redef class CmdCall

nitc :: term $ CmdCall

Retrieve all the mproperties that call mentity
redef class CmdCatalogContributing

nitc :: term $ CmdCatalogContributing

Retrieve the packages contributed by a person
redef class CmdCatalogMaintaining

nitc :: term $ CmdCatalogMaintaining

Retrieve the packages maintained by a person
redef class CmdCatalogPackages

nitc :: term $ CmdCatalogPackages

Retrieve the packages in the catalog
redef class CmdCatalogStats

nitc :: term $ CmdCatalogStats

Retrieve the catalog stats
redef class CmdCatalogTag

nitc :: term $ CmdCatalogTag

Retrieve the packages for a tag
redef class CmdCatalogTags

nitc :: term $ CmdCatalogTags

Retrieve the catalog tags list
redef class CmdChildren

nitc :: term $ CmdChildren

MEntity children command
redef class CmdComment

nitc :: term $ CmdComment

Retrieve the MDoc related to a MEntity
redef class CmdContribFile

nitc :: term $ CmdContribFile

Cmd that finds the contributing file related to an mentity
redef class CmdDescendants

nitc :: term $ CmdDescendants

MEntity descendants command
redef class CmdEntityCode

nitc :: term $ CmdEntityCode

Cmd that finds the source code related to an mentity
redef abstract class CmdEntityFile

nitc :: term $ CmdEntityFile

redef abstract class CmdError

nitc :: term $ CmdError

Command Error
redef class CmdFeatures

nitc :: term $ CmdFeatures

MEntity feature list
redef abstract class CmdGraph

nitc :: term $ CmdGraph

An abstract command that returns a dot graph
redef abstract class CmdIni

nitc :: term $ CmdIni

Cmd that finds the ini file related to an mentity
redef class CmdIniCloneCommand

nitc :: term $ CmdIniCloneCommand

Cmd that finds the git clone command related to an mentity
redef class CmdIniContributors

nitc :: term $ CmdIniContributors

Cmd that finds the contributors list of an mentity
redef class CmdIniDescription

nitc :: term $ CmdIniDescription

Cmd that finds the ini description related to an mentity
redef class CmdIniGitUrl

nitc :: term $ CmdIniGitUrl

Cmd that finds the clone url related to an mentity
redef class CmdIniIssuesUrl

nitc :: term $ CmdIniIssuesUrl

Cmd that finds the issues link related to an mentity
redef class CmdIniLicense

nitc :: term $ CmdIniLicense

Cmd that finds the license related to an mentity
redef class CmdIniMaintainer

nitc :: term $ CmdIniMaintainer

Cmd that finds the maintainer name of an mentity
redef class CmdLicenseFile

nitc :: term $ CmdLicenseFile

Cmd that finds the license file related to an mentity
redef class CmdLinearization

nitc :: term $ CmdLinearization

Linearization command
redef abstract class CmdList

nitc :: term $ CmdList

A command that returns a list of results
redef class CmdMainCompile

nitc :: term $ CmdMainCompile

Cmd that finds the nitc command related to an mentity
redef class CmdMains

nitc :: term $ CmdMains

Cmd that finds the mains of an mentity
redef class CmdManOptions

nitc :: term $ CmdManOptions

redef class CmdManSynopsis

nitc :: term $ CmdManSynopsis

redef abstract class CmdMessage

nitc :: term $ CmdMessage

Command message
redef class CmdModelEntities

nitc :: term $ CmdModelEntities

A command that returns a list of all mentities in a model
redef class CmdNew

nitc :: term $ CmdNew

Retrieve all the mproperties that initialize mentity
redef class CmdParam

nitc :: term $ CmdParam

Retrieve all the mproperties using mentity as a type for its parameters
redef class CmdParents

nitc :: term $ CmdParents

MEntity parents command
redef class CmdReturn

nitc :: term $ CmdReturn

Retrieve all the mproperties that return somethinf of the mentity type.
redef class CmdSearch

nitc :: term $ CmdSearch

A free text search command
redef class CmdTesting

nitc :: term $ CmdTesting

Cmd that finds the nitunit command related to an mentity
redef abstract class CmdWarning

nitc :: term $ CmdWarning

Command Warning
redef class CommandParser

nitc :: term $ CommandParser

Parse string commands to create DocQueries
redef abstract class DocCommand

nitc :: term $ DocCommand

Documentation command
redef class ErrorMEntityConflict

nitc :: term $ ErrorMEntityConflict

Multiple MEntities matching mentity_name
redef class ErrorMEntityNotFound

nitc :: term $ ErrorMEntityNotFound

No MEntity matching mentity_name

All class definitions

redef class CmdAncestors

nitc :: term $ CmdAncestors

MEntity ancestors command
redef class CmdCall

nitc :: term $ CmdCall

Retrieve all the mproperties that call mentity
redef class CmdCatalogContributing

nitc :: term $ CmdCatalogContributing

Retrieve the packages contributed by a person
redef class CmdCatalogMaintaining

nitc :: term $ CmdCatalogMaintaining

Retrieve the packages maintained by a person
redef class CmdCatalogPackages

nitc :: term $ CmdCatalogPackages

Retrieve the packages in the catalog
redef class CmdCatalogStats

nitc :: term $ CmdCatalogStats

Retrieve the catalog stats
redef class CmdCatalogTag

nitc :: term $ CmdCatalogTag

Retrieve the packages for a tag
redef class CmdCatalogTags

nitc :: term $ CmdCatalogTags

Retrieve the catalog tags list
redef class CmdChildren

nitc :: term $ CmdChildren

MEntity children command
redef class CmdComment

nitc :: term $ CmdComment

Retrieve the MDoc related to a MEntity
redef class CmdContribFile

nitc :: term $ CmdContribFile

Cmd that finds the contributing file related to an mentity
redef class CmdDescendants

nitc :: term $ CmdDescendants

MEntity descendants command
redef class CmdEntityCode

nitc :: term $ CmdEntityCode

Cmd that finds the source code related to an mentity
redef abstract class CmdEntityFile

nitc :: term $ CmdEntityFile

redef abstract class CmdError

nitc :: term $ CmdError

Command Error
redef class CmdFeatures

nitc :: term $ CmdFeatures

MEntity feature list
redef abstract class CmdGraph

nitc :: term $ CmdGraph

An abstract command that returns a dot graph
redef abstract class CmdIni

nitc :: term $ CmdIni

Cmd that finds the ini file related to an mentity
redef class CmdIniCloneCommand

nitc :: term $ CmdIniCloneCommand

Cmd that finds the git clone command related to an mentity
redef class CmdIniContributors

nitc :: term $ CmdIniContributors

Cmd that finds the contributors list of an mentity
redef class CmdIniDescription

nitc :: term $ CmdIniDescription

Cmd that finds the ini description related to an mentity
redef class CmdIniGitUrl

nitc :: term $ CmdIniGitUrl

Cmd that finds the clone url related to an mentity
redef class CmdIniIssuesUrl

nitc :: term $ CmdIniIssuesUrl

Cmd that finds the issues link related to an mentity
redef class CmdIniLicense

nitc :: term $ CmdIniLicense

Cmd that finds the license related to an mentity
redef class CmdIniMaintainer

nitc :: term $ CmdIniMaintainer

Cmd that finds the maintainer name of an mentity
redef class CmdLicenseFile

nitc :: term $ CmdLicenseFile

Cmd that finds the license file related to an mentity
redef class CmdLinearization

nitc :: term $ CmdLinearization

Linearization command
redef abstract class CmdList

nitc :: term $ CmdList

A command that returns a list of results
redef class CmdMainCompile

nitc :: term $ CmdMainCompile

Cmd that finds the nitc command related to an mentity
redef class CmdMains

nitc :: term $ CmdMains

Cmd that finds the mains of an mentity
redef class CmdManOptions

nitc :: term $ CmdManOptions

redef class CmdManSynopsis

nitc :: term $ CmdManSynopsis

redef abstract class CmdMessage

nitc :: term $ CmdMessage

Command message
redef class CmdModelEntities

nitc :: term $ CmdModelEntities

A command that returns a list of all mentities in a model
redef class CmdNew

nitc :: term $ CmdNew

Retrieve all the mproperties that initialize mentity
redef class CmdParam

nitc :: term $ CmdParam

Retrieve all the mproperties using mentity as a type for its parameters
redef class CmdParents

nitc :: term $ CmdParents

MEntity parents command
redef class CmdReturn

nitc :: term $ CmdReturn

Retrieve all the mproperties that return somethinf of the mentity type.
redef class CmdSearch

nitc :: term $ CmdSearch

A free text search command
redef class CmdTesting

nitc :: term $ CmdTesting

Cmd that finds the nitunit command related to an mentity
redef abstract class CmdWarning

nitc :: term $ CmdWarning

Command Warning
redef class CommandParser

nitc :: term $ CommandParser

Parse string commands to create DocQueries
redef abstract class DocCommand

nitc :: term $ DocCommand

Documentation command
redef class ErrorMEntityConflict

nitc :: term $ ErrorMEntityConflict

Multiple MEntities matching mentity_name
redef class ErrorMEntityNotFound

nitc :: term $ ErrorMEntityNotFound

No MEntity matching mentity_name
package_diagram nitc::term term nitc::commands_parser commands_parser nitc::term->nitc::commands_parser nitc::term_model term_model nitc::term->nitc::term_model nitc::md_commands md_commands nitc::term->nitc::md_commands nitc::commands_catalog commands_catalog nitc::commands_parser->nitc::commands_catalog nitc::commands_graph commands_graph nitc::commands_parser->nitc::commands_graph nitc::commands_ini commands_ini nitc::commands_parser->nitc::commands_ini nitc::commands_main commands_main nitc::commands_parser->nitc::commands_main nitc::commands_usage commands_usage nitc::commands_parser->nitc::commands_usage nitc::model_collect model_collect nitc::term_model->nitc::model_collect nitc::md_commands->nitc::commands_catalog nitc::md_commands->nitc::commands_graph nitc::md_commands->nitc::commands_ini nitc::md_commands->nitc::commands_main nitc::md_commands->nitc::commands_usage nitc::highlight highlight nitc::md_commands->nitc::highlight ...nitc::commands_catalog ... ...nitc::commands_catalog->nitc::commands_catalog ...nitc::commands_graph ... ...nitc::commands_graph->nitc::commands_graph ...nitc::commands_ini ... ...nitc::commands_ini->nitc::commands_ini ...nitc::commands_main ... ...nitc::commands_main->nitc::commands_main ...nitc::commands_usage ... ...nitc::commands_usage->nitc::commands_usage ...nitc::model_collect ... ...nitc::model_collect->nitc::model_collect ...nitc::highlight ... ...nitc::highlight->nitc::highlight nitc::nitx nitx nitc::nitx->nitc::term a_star-m a_star-m a_star-m->nitc::nitx a_star-m... ... a_star-m...->a_star-m

Ancestors

module abstract_collection

core :: abstract_collection

Abstract collection classes and services.
module abstract_text

core :: abstract_text

Abstract class for manipulation of sequences of characters
module abstract_tree

trees :: abstract_tree

Introduce tree structures abstraction
module actors_injection_phase

nitc :: actors_injection_phase

Injects model for the classes annotated with "is actor" so
module annotation

nitc :: annotation

Management and utilities on annotations
module array

core :: array

This module introduces the standard array structure.
module astbuilder

nitc :: astbuilder

Instantiation and transformation of semantic nodes in the AST of expressions and statements
module astutil

nitc :: astutil

Additional features on Nit AST
module auto_super_init

nitc :: auto_super_init

Computing of super-constructors that must be implicitly called at the begin of constructors.
module bintree

trees :: bintree

Binary Tree data-structure
module bitset

core :: bitset

Services to handle BitSet
module bktree

trees :: bktree

Implementation of BKTree
module bytes

core :: bytes

Services for byte streams and arrays
module caching

serialization :: caching

Services for caching serialization engines
module catalog

nitc :: catalog

Basic catalog generator for Nit packages
module check_annotation

nitc :: check_annotation

Check that annotation present in the AST are either primitive or user-declared
module circular_array

core :: circular_array

Efficient data structure to access both end of the sequence.
module codec_base

core :: codec_base

Base for codecs to use with streams
module codecs

core :: codecs

Group module for all codec-related manipulations
module collection

core :: collection

This module define several collection classes.
module commands_base

nitc :: commands_base

Documentation commands
module commands_catalog

nitc :: commands_catalog

Commands to retrieve Catalog related data
module commands_graph

nitc :: commands_graph

Graph commands
module commands_model

nitc :: commands_model

Doc commands about a Model or a MEntity
module commands_usage

nitc :: commands_usage

Commands about how mentities are used
module console

console :: console

Defines some ANSI Terminal Control Escape Sequences.
module core

core :: core

Standard classes and methods used by default by Nit programs and libraries.
module counter

counter :: counter

Simple numerical statistical analysis and presentation
module deriving

nitc :: deriving

Injection of automatic method definitions for standard methods, based on the attributes of the classes
module digraph

graph :: digraph

Implementation of directed graphs, also called digraphs.
module div_by_zero

nitc :: div_by_zero

Detection of divisions by zero in obvious cases
module dot

dot :: dot

Dot rendering library
module engine_tools

serialization :: engine_tools

Advanced services for serialization engines
module environ

core :: environ

Access to the environment variables of the process
module error

core :: error

Standard error-management infrastructure.
module exec

core :: exec

Invocation and management of operating system sub-processes.
module file

core :: file

File manipulations (create, read, write, etc.)
module fixed_ints

core :: fixed_ints

Basic integers of fixed-precision
module fixed_ints_text

core :: fixed_ints_text

Text services to complement fixed_ints
module flat

core :: flat

All the array-based text representations
module flow

nitc :: flow

Intraprocedural static flow.
module frontend

nitc :: frontend

Collect and orchestration of main frontend phases
module gc

core :: gc

Access to the Nit internal garbage collection mechanism
module glsl_validation

nitc :: glsl_validation

Check shader code within Nit modules using the tool glslangValidator
module hash_collection

core :: hash_collection

Introduce HashMap and HashSet.
module highlight

nitc :: highlight

Highlighting of Nit AST
module html

html :: html

HTML output facilities
module i18n_phase

nitc :: i18n_phase

Basic support of internationalization through the generation of id-to-string tables
module ini

ini :: ini

Read and write INI configuration files
module inspect

serialization :: inspect

Refine Serializable::inspect to show more useful information
module iso8859_1

core :: iso8859_1

Codec for ISO8859-1 I/O
module kernel

core :: kernel

Most basic classes and methods.
module lexer

nitc :: lexer

Lexer and its tokens.
module lexer_work

nitc :: lexer_work

Internal algorithm and data structures for the Nit lexer
module list

core :: list

This module handle double linked lists
module literal

nitc :: literal

Parsing of literal values in the abstract syntax tree.
module loader

nitc :: loader

Loading of Nit source files
module local_var_init

nitc :: local_var_init

Verify that local variables are initialized before their usage
module location

nitc :: location

Nit source-file and locations in source-file
module math

core :: math

Mathematical operations
module md5

md5 :: md5

Native MD5 digest implementation as Text::md5
module mdoc

nitc :: mdoc

Documentation of model entities
module meta

meta :: meta

Simple user-defined meta-level to manipulate types of instances as object.
module mmodule

nitc :: mmodule

modules and module hierarchies in the metamodel
module mmodule_data

nitc :: mmodule_data

Define and retrieve data in modules
module model

nitc :: model

Classes, types and properties
module model_base

nitc :: model_base

The abstract concept of model and related common things
module model_collect

nitc :: model_collect

Collect things from the model.
module model_examples

nitc :: model_examples

Examples for Model entities
module model_index

nitc :: model_index

Search things from the Model
module modelbuilder_base

nitc :: modelbuilder_base

Load nit source files and build the associated model
module modelize

nitc :: modelize

Create a model from nit source files
module modelize_class

nitc :: modelize_class

Analysis and verification of class definitions to instantiate model element
module modelize_property

nitc :: modelize_property

Analysis and verification of property definitions to instantiate model element
module more_collections

more_collections :: more_collections

Highly specific, but useful, collections-related classes.
module mpackage

nitc :: mpackage

Modelisation of a Nit package
module native

core :: native

Native structures for text and bytes
module nitpm_shared

nitc :: nitpm_shared

Services related to the Nit package manager
module no_warning

nitc :: no_warning

Fill toolcontext information about blacklisting of warnings.
module numeric

core :: numeric

Advanced services for Numeric types
module opts

opts :: opts

Management of options on the command line
module ordered_tree

ordered_tree :: ordered_tree

Manipulation and presentation of ordered trees.
module parallelization_phase

nitc :: parallelization_phase

Phase generating threads for functions annotated with threaded annotation
module parse_annotations

nitc :: parse_annotations

Simple annotation parsing
module parser

nitc :: parser

Parser.
module parser_nodes

nitc :: parser_nodes

AST nodes of the Nit language
module parser_prod

nitc :: parser_prod

Production AST nodes full definition.
module parser_util

nitc :: parser_util

Utils and tools related to parsers and AST
module parser_work

nitc :: parser_work

Internal algorithm and data structures for the Nit parser
module phase

nitc :: phase

Phases of the processing of nit programs
module poset

poset :: poset

Pre order sets and partial order set (ie hierarchies)
module protocol

core :: protocol

module queue

core :: queue

Queuing data structures and wrappers
module range

core :: range

Module for range of discrete objects.
module rbtree

trees :: rbtree

A red–black tree is a data structure which is a type of self-balancing binary search tree.
module re

core :: re

Regular expression support for all services based on Pattern
module regex_phase

nitc :: regex_phase

Check for error in regular expressions from string literals
module ropes

core :: ropes

Tree-based representation of a String.
module scope

nitc :: scope

Identification and scoping of local variables and labels.
module semantize

nitc :: semantize

Process bodies of methods in regard with the model.
module serialization

serialization :: serialization

General serialization services
module serialization_core

serialization :: serialization_core

Abstract services to serialize Nit objects to different formats
module serialization_model_phase

nitc :: serialization_model_phase

Phase generating methods (model-only) to serialize Nit objects
module simple_misc_analysis

nitc :: simple_misc_analysis

Simple vavious processing on a AST
module sorter

core :: sorter

This module contains classes used to compare things and sorts arrays.
module stream

core :: stream

Input and output streams of characters
module tables

nitc :: tables

Module that interfaces the parsing tables.
module template

template :: template

Basic template system
module text

core :: text

All the classes and methods related to the manipulation of text entities
module time

core :: time

Management of time and dates
module toolcontext

nitc :: toolcontext

Common command-line tool infrastructure than handle options and error messages
module trees

trees :: trees

General module for tree data structures
module trie

trees :: trie

A trie (or prefix tree) is a datastructure used to perform prefix searches.
module typing

nitc :: typing

Intraprocedural resolution of static types and OO-services
module uml

nitc :: uml

Group head module for UML generation services
module uml_base

nitc :: uml_base

Exposes the base class for UML generation of a Model
module uml_class

nitc :: uml_class

Provides facilities of exporting a Model to a UML class diagram
module uml_module

nitc :: uml_module

Services for generation of a UML package diagram based on a Model
module union_find

core :: union_find

union–find algorithm using an efficient disjoint-set data structure
module utf8

core :: utf8

Codec for UTF-8 I/O
module version

nitc :: version

This file was generated by git-gen-version.sh

Parents

module commands_parser

nitc :: commands_parser

A parser that create DocCommand from a string
module md_commands

nitc :: md_commands

Render commands results as Markdown
module term_model

nitc :: term_model

Markdown templates for Nit model MEntities.

Children

module nitx

nitc :: nitx

nitx, a command tool that displays useful data about Nit code

Descendants

module a_star-m

a_star-m

module term

import commands::commands_parser
import templates::term_model
import templates::md_commands

redef class CommandParser

	fun execute(query: String, no_color: nullable Bool) do
		var cmd = self.parse(query)
		var error = self.error

		# Translate links to doc commands
		if cmd isa CmdEntityLink then
			cmd = new CmdComment(model, mentity_name = query)
			var opts = new CmdOptions
			var status = cmd.parser_init(query, opts)
			if not status isa CmdSuccess then error = status
		end

		if error isa CmdError or error isa CmdWarning then
			error.print_message(no_color)
			print ""
		end
		if cmd == null then return
		cmd.execute(no_color)
	end
end

redef class DocCommand
	fun execute(no_color: nullable Bool) is abstract
end

redef class CmdMessage
	fun print_message(no_color: nullable Bool) do print to_s
end

redef class CmdError
	redef fun print_message(no_color) do
		var res = "Error: {to_s}"
		if no_color == null or not no_color then res = res.bold.red
		print res
	end
end

redef class CmdWarning
	redef fun print_message(no_color) do
		var res = "Warning: {to_s}"
		if no_color == null or not no_color then res = res.bold.yellow
		print res
	end
end

# Model queries

redef class ErrorMEntityNotFound
	redef fun print_message(no_color) do
		if no_color == null or not no_color then
			print "No result found for `{mentity_name.blue}`...".bold
		else
			print "No result found for `{mentity_name}`..."
		end
		print ""
		if suggestions.not_empty then
			print "Did you mean?"
			print ""
			for s in suggestions do
				print s.cs_list_item(no_color)
				print ""
			end
		end
	end
end

redef class ErrorMEntityConflict
	redef fun print_message(no_color) do
		if no_color == null or not no_color then
			print "Multiple results found for `{mentity_name.blue}`...".bold
		else
			print "Multiple results found for `{mentity_name}`..."
		end
		print ""
		if conflicts.not_empty then
			print "Did you mean?"
			print ""
			for s in conflicts do
				print s.cs_list_item(no_color)
				print ""
			end
		end
	end
end

redef class CmdList
	fun print_list(list_title: nullable String, list_items: nullable Array[MEntity], no_color: nullable Bool) do
		if list_title != null then
			if no_color == null or not no_color then
				print list_title.bold
			else
				print list_title
			end
			print ""
		end
		if list_items != null and list_items.not_empty then
			for mentity in list_items do
				print mentity.cs_list_item(no_color)
				print ""
			end
		else
			print "None."
		end
	end
end

redef class CmdComment
	redef fun execute(no_color) do
		var mentity = self.mentity
		if mentity == null then return

		var full_name = mentity.cs_full_name(no_color)
		if no_color == null or not no_color then
			print "Documentation for `{full_name}`:".bold
		else
			print "Documentation for `{full_name}`:"
		end
		print ""
		print " {mentity.cs_icon(no_color)} {mentity.cs_full_name(no_color)}"
		print "   {mentity.cs_declaration(no_color)}"
		print "   {mentity.cs_location(no_color)}"
		print ""
		var mdoc = self.mdoc
		if mdoc == null then return
		if full_doc then
			print mdoc.cs_comment(no_color, 3)
		else
			print "   {mdoc.cs_short_comment(no_color)}\n"
		end
	end
end

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

redef class CmdParents
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Parents for `{full_name}`:", results, no_color)
	end
end

redef class CmdChildren
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Children for `{full_name}`:", results, no_color)
	end
end

redef class CmdDescendants
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Descendants for `{full_name}`:", results, no_color)
	end
end

redef class CmdLinearization
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Linearization for `{full_name}`:", results, no_color)
	end
end

redef class CmdSearch
	redef fun execute(no_color) do
		print_list("Search results for `{query.as(not null)}`:", results, no_color)
	end
end

redef class CmdModelEntities
	redef fun execute(no_color) do
		var kind = self.kind
		if no_color != null and not no_color then kind = kind.blue
		print_list("MEntities for kind `{kind}`:", results, no_color)
	end
end

redef class CmdFeatures
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Features for `{full_name}`:", results, no_color)
	end
end

redef class CmdEntityCode

	redef var format = "ansi" is optional

	redef fun execute(no_color) do
		var mentity = self.mentity
		if mentity == null then return

		var title = "Code for `{mentity.cs_full_name(no_color)}`:"
		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end
		var node = self.node
		if (no_color == null or not no_color) and node != null then
			var ansi = render_code(node)
			print "~~~"
			print ansi.write_to_string
			print "~~~"
		else
			printn mentity.cs_source_code
		end
	end
end

redef class CmdGraph
	redef fun execute(no_color) do
		format = "dot"
		var dot = self.render
		if dot == null then return
		var f = new ProcessWriter("dot", "-Txlib")
		f.write dot.write_to_string
		f.close
		f.wait
	end
end

# CmdUsage

redef class CmdCall
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Methods calling `{full_name}`:", results, no_color)
	end
end

redef class CmdNew
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Methods intializing `{full_name}`:", results, no_color)
	end
end

redef class CmdReturn
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Methods returning `{full_name}`:", results, no_color)
	end
end

redef class CmdParam
	redef fun execute(no_color) do
		var full_name = mentity.as(not null).cs_full_name(no_color)
		print_list("Methods accepting `{full_name}` as parameter:", results, no_color)
	end
end

# CmdCatalog

redef class CmdCatalogPackages
	redef fun execute(no_color) do
		print_list("Packages from catalog:", results, no_color)
	end
end

redef class CmdCatalogStats
	redef fun execute(no_color) do
		if no_color == null or not no_color then
			print "Catalog statistics:".bold
		else
			print "Catalog statistics:"
		end

		var stats = self.stats.as(not null)
		print " * {stats.packages} packages"
		print " * {stats.modules} modules"
		print " * {stats.methods} methods"
		print " * {stats.classes} classes"
		print " * {stats.loc} lines of code"
		print " * {stats.contributors} contributors"
		print " * {stats.maintainers} maintainers"
		print " * {stats.tags} tags"
	end
end

redef class CmdCatalogTags
	redef fun execute(no_color) do
		if no_color == null or not no_color then
			print "Tags from catalog:".bold
		else
			print "Tags from catalog:"
		end

		print ""
		var counts = self.packages_count_by_tags.as(not null)
		for tag, count in counts do
			if no_color == null or not no_color then
				print " * {tag.blue.bold}: {count} packages"
			else
				print " * {tag}: {count} packages"
			end
		end
	end
end

redef class CmdCatalogTag
	redef fun execute(no_color) do
		var tag = self.tag.as(not null)
		if no_color == null or not no_color then tag = tag.blue.bold
		print_list("Packages tagged with `{tag}`:", results, no_color)
	end
end

redef class CmdCatalogMaintaining
	redef fun execute(no_color) do
		var name = self.person_name.as(not null)
		if no_color == null or not no_color then name = name.blue.bold
		print_list("Packages maintained by `{name}`:", results, no_color)
	end
end

redef class CmdCatalogContributing
	redef fun execute(no_color) do
		var name = self.person_name.as(not null)
		if no_color == null or not no_color then name = name.blue.bold
		print_list("Packages contributed by `{name}`:", results, no_color)
	end
end

# CmdIni

redef class CmdIni
	# Print ini data
	fun print_ini(title: String, data: nullable String, no_color: nullable Bool) do
		if data == null then return
		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end
		print ""
		print data
	end
end

redef class CmdIniDescription
	redef fun execute(no_color) do
		var title = "Description from ini file:"
		print_ini(title, desc, no_color)
	end
end

redef class CmdIniGitUrl
	redef fun execute(no_color) do
		var title = "Git URL from ini file:"
		print_ini(title, url, no_color)
	end
end

redef class CmdIniCloneCommand
	redef fun execute(no_color) do
		var title = "Git clone command from ini file:"
		print_ini(title, command, no_color)
	end
end

redef class CmdIniIssuesUrl
	redef fun execute(no_color) do
		var title = "Issues URL from ini file:"
		print_ini(title, url, no_color)
	end
end

redef class CmdIniMaintainer
	redef fun execute(no_color) do
		var title = "Maintainer from ini file:"
		print_ini(title, maintainer, no_color)
	end
end

redef class CmdIniContributors
	redef fun execute(no_color) do
		var contributors = self.contributors
		if contributors == null then return
		var title = "Contributors list from ini file:"
		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end
		print ""
		for contributor in contributors do
			print " * {contributor}"
		end
	end
end

redef class CmdIniLicense
	redef fun execute(no_color) do
		var title = "License from ini file:"
		print_ini(title, license, no_color)
	end
end

redef class CmdEntityFile

	# Print file
	fun print_file(title: String, no_color: nullable Bool) do
		var file = self.file
		if file == null then return
		title = "{title} `{file}`:"
		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end
		print ""
		print file.to_path.read_all
		print ""
	end
end

redef class CmdLicenseFile
	redef fun execute(no_color) do
		print_file("License from", no_color)
	end
end

redef class CmdContribFile
	redef fun execute(no_color) do
		print_file("Contributing rules from", no_color)
	end
end

# CmdMain

redef class CmdMains
	redef fun execute(no_color) do
		var mentity = self.mentity.as(not null).full_name
		if no_color == null or not no_color then mentity = mentity.blue.bold
		print_list("Mains in `{mentity}`:", results, no_color)
	end
end

redef class CmdMainCompile
	redef fun execute(no_color) do
		var mentity = self.mentity.as(not null).full_name
		if no_color == null or not no_color then mentity = mentity.blue.bold
		var title = "Compiling `{mentity}`:"

		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end

		print ""
		var command = self.command
		if command != null then print command
	end
end

redef class CmdTesting
	redef fun execute(no_color) do
		var mentity = self.mentity.as(not null).full_name
		if no_color == null or not no_color then mentity = mentity.blue.bold
		var title = "Testing `{mentity}`:"

		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end

		print ""
		var command = self.command
		if command != null then print command
	end
end

redef class CmdManSynopsis
	redef fun execute(no_color) do
		var mentity = self.mentity.as(not null).full_name
		if no_color == null or not no_color then mentity = mentity.blue.bold
		var title = "Synopsis for `{mentity}`:"

		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end

		print ""
		var synopsis = self.synopsis
		if synopsis != null then print synopsis
	end
end

redef class CmdManOptions
	redef fun execute(no_color) do
		var mentity = self.mentity.as(not null).full_name
		if no_color == null or not no_color then mentity = mentity.blue.bold
		var title = "Options for `{mentity}`:"

		if no_color == null or not no_color then
			print title.bold
		else
			print title
		end

		print ""
		var options = self.options.as(not null)
		for opt, desc in options do
			if no_color == null or not no_color then
				print " * {opt.blue.bold}: {desc}"
			else
				print " * {opt}: {desc}"
			end
		end
	end
end
src/doc/term/term.nit:15,1--542,3