How to use the arg.COUNT function in arg

To help you get started, we’ve selected a few arg 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 marktext / marktext / src / main / cli / parser.js View on Github external
}
  const spec = {
    '--debug': Boolean,
    '--safe': Boolean,
    '--dump-keyboard-layout': Boolean,

    '--new-window': Boolean,
    '-n': '--new-window',

    '--disable-gpu': Boolean,
    '--user-data-dir': String,

    // Misc
    '--help': Boolean,
    '-h': '--help',
    '--verbose': arg.COUNT,
    '-v': '--verbose',
    '--version': Boolean
  }
  return arg(spec, { argv, permissive })
}

arg

Unopinionated, no-frills CLI argument parser

MIT
Latest version published 2 years ago

Package Health Score

74 / 100
Full package analysis

Popular arg functions