unix/func

[Feature] Life cycle hook in all commands

unix opened this issue · 1 comments

unix commented

Expected:

  • add life cycle hooks
  • include at least init
  • support async function
  • No breaking changes

Examples:

export class Command implements Init {
  async init(): void {}
}

Programme:

  • Add Init abstract class
  • Check the init hook at initialization and call it if it exists

Others:

  • Is it possible to capture exit code to achieve exit? (like user exit: command + c or error)
unix commented

It looks over-design, marked as pending.