How to use the @oclif/parser.flags function in @oclif/parser

To help you get started, we’ve selected a few @oclif/parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oclif / command / src / flags.ts View on Github external
export const version = (opts: Partial> = {}) => {
  return Parser.flags.boolean({
    // char: 'v',
    description: 'show CLI version',
    ...opts,
    parse: (_: any, cmd: Command) => {
      cmd.log(cmd.config.userAgent)
      cmd.exit(0)
    },
  })
}
export const help = (opts: Partial> = {}) => {
github oclif / command / src / flags.ts View on Github external
export function build(defaults: Partial>): Definition {
  return Parser.flags.build(defaults as any)
}

@oclif/parser

arg and flag parser for oclif

MIT
Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis