{"version":3,"file":"Command.cjs","sources":["../../../../../packages/cli-common/src/application/Command.ts"],"sourcesContent":["import { CommandConfiguration } from './CommandConfiguration'\nimport { Arguments, Input, Options } from './Input'\n\nexport abstract class Command<Args extends Arguments, TOptions extends Options> {\n\tprivate configuration: CommandConfiguration<Args, TOptions> | undefined\n\n\tprotected abstract configure(configuration: CommandConfiguration<Args, TOptions>): void\n\n\tpublic getConfiguration(): CommandConfiguration<Args, TOptions> {\n\t\tif (this.configuration === undefined) {\n\t\t\tconst configuration = new CommandConfiguration()\n\t\t\tthis.configure(configuration)\n\t\t\tconfiguration.validate()\n\t\t\tthis.configuration = configuration\n\t\t}\n\t\treturn this.configuration\n\t}\n\n\tprotected abstract execute(input: Input<Args, TOptions>): Promise<void | number>\n\n\tpublic async run(args: string[]): Promise<number> {\n\t\tconst parser = this.getConfiguration().createParser()\n\t\tconst input = parser.parse<Args, TOptions>(args)\n\t\tconst result = await this.execute(input)\n\t\treturn result || 0\n\t}\n}\n"],"names":["CommandConfiguration"],"mappings":";;;;;;AAGO,MAAe,QAA0D;AAAA,EAAzE,cAAA;AACE,kBAAA,MAAA,eAAA;AAAA,EAAA;AAAA,EAID,mBAAyD;AAC3D,QAAA,KAAK,kBAAkB,QAAW;AAC/B,YAAA,gBAAgB,IAAIA,0CAAqB;AAC/C,WAAK,UAAU,aAAa;AAC5B,oBAAc,SAAS;AACvB,WAAK,gBAAgB;AAAA,IAAA;AAEtB,WAAO,KAAK;AAAA,EAAA;AAAA,EAKb,MAAa,IAAI,MAAiC;AACjD,UAAM,SAAS,KAAK,iBAAiB,EAAE,aAAa;AAC9C,UAAA,QAAQ,OAAO,MAAsB,IAAI;AAC/C,UAAM,SAAS,MAAM,KAAK,QAAQ,KAAK;AACvC,WAAO,UAAU;AAAA,EAAA;AAEnB;;"}