Skip to content

add decorator to define options #2

@thatkookooguy

Description

@thatkookooguy

FEATURE

Currently, you can define parameters for each function and how each parameter will behave. but what about flags? (e.g. --username neil or -u neil)

Suggested behavior:

@cliOptions([
  ['username', 'The username to get data for']
])
static getUser(arg1, arg2, options) {
  if (!options.username) { throw new Error('username is required') }

  console.log(`this is our username: ${ options.username }`);
}

it will automatically add those flags to this specific function and attach it to the end of the arguments list (like a callback for example).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions