Détail du package

@anycli/parser

anycli61MIT3.2.6

arg and flag parser for anycli

anycli

readme

@anycli/parser

arg and flag parser for anycli

Version CircleCI Appveyor CI Codecov Greenkeeper Known Vulnerabilities Downloads/week License

CLI flag parser.

Usage:

const CLI = require('cli-flags')

const {flags, args} = CLI.parse({
  flags: {
    'output-file': CLI.flags.string({char: 'o'}),
    force: CLI.flags.boolean({char: 'f'})
  },
  args: [
    {name: 'input', required: true}
  ]
})

if (flags.force) {
  console.log('--force was set')
}

if (flags['output-file']) {
  console.log(`output file is: ${flags['output-file']}`)
}

console.log(`input arg: ${args.input}`)

// $ node example.js -f myinput --output-file=myexample.txt
// --force was set
// output file is: myexample.txt
// input arg: myinput

changelog

3.2.6 (2018-02-06)

Bug Fixes

3.2.5 (2018-02-05)

Bug Fixes

3.2.4 (2018-02-05)

Bug Fixes

3.2.3 (2018-02-05)

Bug Fixes

  • optionally require chalk (840676d)

3.2.2 (2018-02-03)

Bug Fixes

3.2.1 (2018-02-03)

Bug Fixes

  • rename ParserInput to Input and ParserOutput to Output (f46fa41)

3.2.0 (2018-02-03)

Features

3.1.1 (2018-02-03)

Bug Fixes

3.1.0 (2018-02-03)

Features

3.0.4 (2018-02-01)

Bug Fixes

3.0.3 (2018-02-01)

Bug Fixes

  • added options to flags/args (6a33b06)

3.0.2 (2018-02-01)

Bug Fixes

3.0.1 (2018-02-01)

Bug Fixes

0.1.4 (2018-01-31)

Bug Fixes

0.1.3 (2018-01-31)

Bug Fixes

0.1.2 (2018-01-31)

Bug Fixes

0.1.1 (2018-01-30)

Bug Fixes

0.1.0 (2018-01-30)

Bug Fixes

Features

0.0.6 (2018-01-30)

Bug Fixes

  • add typing to flag output (967cd55)

0.0.5 (2018-01-26)

Bug Fixes

0.0.4 (2018-01-20)

Bug Fixes

0.0.3 (2018-01-20)

Bug Fixes

  • fixed reference to screen (f516f33)

0.0.2 (2018-01-16)

Bug Fixes

0.0.1 (2018-01-15)

Bug Fixes