import {Unit} from "@extollo/lib" import {Singleton, Instantiable} from "@extollo/di" import {Collection} from "@extollo/util" import {CommandLineApplication} from "./CommandLineApplication" import {Directive} from "../Directive"; @Singleton() export class CommandLine extends Unit { protected directives: Collection> = new Collection>() constructor() { super() } public isCLI() { return this.app().hasUnit(CommandLineApplication) } public getASCIILogo() { return ` ______ _ _ _ | ____| | | | | | | |__ __ _| |_ ___ | | | ___ | __| \\ \\/ / __/ _ \\| | |/ _ \\ | |____ > <| || (_) | | | (_) | |______/_/\\_\\\\__\\___/|_|_|\\___/` } public registerDirective(directiveClass: Instantiable) { if ( !this.directives.includes(directiveClass) ) { this.directives.push(directiveClass) } } public hasDirective(directiveClass: Instantiable) { return this.directives.includes(directiveClass) } public getDirectives() { return this.directives.clone() } }