import { OptionValue, Option } from '../../Option'; export abstract class InteractiveSubSource { protected val: OptionValue; protected opt: Option; protected abstract condition():boolean; protected abstract async run():Promise; public constructor ( val:OptionValue, opt:Option ) { this.val = val; this.opt = opt; } public async parse ():Promise { if (this.condition ()) await this.run (); } protected get_message (): string { return typeof this.opt.message === 'undefined' ? `input ${this.opt.name}` : this.opt.message; } }