static flags = {
loglevel: flags.string({ options: ['error', 'warn', 'info', 'debug'] })
}
....
async init() {
// do some initialization
const { flags } = this.parse(this.constructor)
this.flags = flags
}
Is that code in init correct? If it is, it sure if confusing. There is a lot of shadowing with the flags
variable:
I just wanted to check if the this.flags was intentional. And if so, maybe comment about (at least my) confusion.
Also, I am not sure what exactly is "required" for the base command class. Does one even need the init
method? Or can it be simply used for flags aggregation?