Simple email application for Android. Original source code: https://framagit.org/dystopia-project/simple-email
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.

125 lines
3.6 KiB

  1. <p align="center">
  2. <img width="250" src="/yargs-logo.png">
  3. </p>
  4. <h1 align="center"> Yargs </h1>
  5. <p align="center">
  6. <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b>
  7. </p>
  8. <br>
  9. [![Build Status][travis-image]][travis-url]
  10. [![Coverage Status][coveralls-image]][coveralls-url]
  11. [![NPM version][npm-image]][npm-url]
  12. [![Windows Tests][windows-image]][windows-url]
  13. [![js-standard-style][standard-image]][standard-url]
  14. [![Conventional Commits][conventional-commits-image]][conventional-commits-url]
  15. [![Slack][slack-image]][slack-url]
  16. ## Description :
  17. Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.
  18. It gives you:
  19. * commands and (grouped) options (`my-program.js serve --port=5000`).
  20. * a dynamically generated help menu based on your arguments.
  21. > <img width="400" src="/screen.png">
  22. * bash-completion shortcuts for commands and options.
  23. * and [tons more](/docs/api.md).
  24. ## Installation
  25. Stable version:
  26. ```bash
  27. npm i yargs --save
  28. ```
  29. Bleeding edge version with the most recent features:
  30. ```bash
  31. npm i yargs@next --save
  32. ```
  33. ## Usage :
  34. ### Simple Example
  35. ````javascript
  36. #!/usr/bin/env node
  37. const argv = require('yargs').argv
  38. if (argv.ships > 3 && argv.distance < 53.5) {
  39. console.log('Plunder more riffiwobbles!')
  40. } else {
  41. console.log('Retreat from the xupptumblers!')
  42. }
  43. ````
  44. ```bash
  45. $ ./plunder.js --ships=4 --distance=22
  46. Plunder more riffiwobbles!
  47. $ ./plunder.js --ships 12 --distance 98.7
  48. Retreat from the xupptumblers!
  49. ```
  50. ### Complex Example
  51. ```javascript
  52. #!/usr/bin/env node
  53. require('yargs') // eslint-disable-line
  54. .command('serve [port]', 'start the server', (yargs) => {
  55. yargs
  56. .positional('port', {
  57. describe: 'port to bind on',
  58. default: 5000
  59. })
  60. }, (argv) => {
  61. if (argv.verbose) console.info(`start server on :${argv.port}`)
  62. serve(argv.port)
  63. })
  64. .option('verbose', {
  65. alias: 'v',
  66. default: false
  67. })
  68. .argv
  69. ```
  70. Run the example above with `--help` to see the help for the application.
  71. ## Community :
  72. Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com).
  73. ## Documentation :
  74. ### Table of Contents
  75. * [Yargs' API](/docs/api.md)
  76. * [Examples](/docs/examples.md)
  77. * [Parsing Tricks](/docs/tricks.md)
  78. * [Stop the Parser](/docs/tricks.md#stop)
  79. * [Negating Boolean Arguments](/docs/tricks.md#negate)
  80. * [Numbers](/docs/tricks.md#numbers)
  81. * [Arrays](/docs/tricks.md#arrays)
  82. * [Objects](/docs/tricks.md#objects)
  83. * [Advanced Topics](/docs/advanced.md)
  84. * [Composing Your App Using Commands](/docs/advanced.md#commands)
  85. * [Building Configurable CLI Apps](/docs/advanced.md#configuration)
  86. * [Customizing Yargs' Parser](/docs/advanced.md#customizing)
  87. * [Contributing](/contributing.md)
  88. [travis-url]: https://travis-ci.org/yargs/yargs
  89. [travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg
  90. [coveralls-url]: https://coveralls.io/github/yargs/yargs
  91. [coveralls-image]: https://img.shields.io/coveralls/yargs/yargs.svg
  92. [npm-url]: https://www.npmjs.com/package/yargs
  93. [npm-image]: https://img.shields.io/npm/v/yargs.svg
  94. [windows-url]: https://ci.appveyor.com/project/bcoe/yargs-ljwvf
  95. [windows-image]: https://img.shields.io/appveyor/ci/bcoe/yargs-ljwvf/master.svg?label=Windows%20Tests
  96. [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
  97. [standard-url]: http://standardjs.com/
  98. [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
  99. [conventional-commits-url]: https://conventionalcommits.org/
  100. [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg
  101. [slack-url]: http://devtoolscommunity.herokuapp.com