You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.2 KiB
49 lines
1.2 KiB
import AppClass from '../../../lib/src/lifecycle/AppClass.ts'
|
|
import {Logging} from '../../../lib/src/service/logging/Logging.ts'
|
|
import {parseArgs} from '../../../lib/src/external/std.ts'
|
|
|
|
export type ParsedArguments = { [key: string]: string | number | Array<string | number> }
|
|
|
|
export abstract class Directive extends AppClass {
|
|
public abstract readonly keyword: string
|
|
public abstract readonly help: string
|
|
|
|
protected argv: string[] = []
|
|
protected parsed_argv: ParsedArguments = {}
|
|
|
|
static options() {
|
|
return []
|
|
}
|
|
|
|
public prepare(argv: string[], parsed_arguments: ParsedArguments) {
|
|
this.argv = argv
|
|
this.parsed_argv = parsed_arguments
|
|
}
|
|
|
|
public abstract invoke(): any
|
|
|
|
success(message: any) {
|
|
this.make(Logging).success(message, true)
|
|
}
|
|
|
|
error(message: any) {
|
|
this.make(Logging).error(message, true)
|
|
}
|
|
|
|
warn(message: any) {
|
|
this.make(Logging).warn(message, true)
|
|
}
|
|
|
|
info(message: any) {
|
|
this.make(Logging).info(message, true)
|
|
}
|
|
|
|
debug(message: any) {
|
|
this.make(Logging).debug(message, true)
|
|
}
|
|
|
|
verbose(message: any) {
|
|
this.make(Logging).verbose(message, true)
|
|
}
|
|
}
|