Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

readme.markdown 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. # minimist
  2. parse argument options
  3. This module is the guts of optimist's argument parser without all the
  4. fanciful decoration.
  5. [![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)
  6. [![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)
  7. # example
  8. ``` js
  9. var argv = require('minimist')(process.argv.slice(2));
  10. console.dir(argv);
  11. ```
  12. ```
  13. $ node example/parse.js -a beep -b boop
  14. { _: [], a: 'beep', b: 'boop' }
  15. ```
  16. ```
  17. $ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
  18. { _: [ 'foo', 'bar', 'baz' ],
  19. x: 3,
  20. y: 4,
  21. n: 5,
  22. a: true,
  23. b: true,
  24. c: true,
  25. beep: 'boop' }
  26. ```
  27. # methods
  28. ``` js
  29. var parseArgs = require('minimist')
  30. ```
  31. ## var argv = parseArgs(args, opts={})
  32. Return an argument object `argv` populated with the array arguments from `args`.
  33. `argv._` contains all the arguments that didn't have an option associated with
  34. them.
  35. Numeric-looking arguments will be returned as numbers unless `opts.string` or
  36. `opts.boolean` is set for that argument name.
  37. Any arguments after `'--'` will not be parsed and will end up in `argv._`.
  38. options can be:
  39. * `opts.string` - a string or array of strings argument names to always treat as
  40. strings
  41. * `opts.boolean` - a string or array of strings to always treat as booleans
  42. * `opts.alias` - an object mapping string names to strings or arrays of string
  43. argument names to use as aliases
  44. * `opts.default` - an object mapping string argument names to default values
  45. # install
  46. With [npm](https://npmjs.org) do:
  47. ```
  48. npm install minimist
  49. ```
  50. # license
  51. MIT