help.js 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /**
  2. * @author Toru Nagashima
  3. * @copyright 2016 Toru Nagashima. All rights reserved.
  4. * See LICENSE file in root directory for full license.
  5. */
  6. 'use strict'
  7. // ------------------------------------------------------------------------------
  8. // Public Interface
  9. // ------------------------------------------------------------------------------
  10. /**
  11. * Print a help text.
  12. *
  13. * @param {stream.Writable} output - A writable stream to print.
  14. * @returns {Promise} Always a fulfilled promise.
  15. * @private
  16. */
  17. module.exports = function printHelp (output) {
  18. output.write(`
  19. Usage:
  20. $ run-p [--help | -h | --version | -v]
  21. $ run-p [OPTIONS] <tasks>
  22. Run given npm-scripts in parallel.
  23. <tasks> : A list of npm-scripts' names and Glob-like patterns.
  24. Options:
  25. --aggregate-output - - - Avoid interleaving output by delaying printing of
  26. each command's output until it has finished.
  27. -c, --continue-on-error - Set the flag to continue executing other tasks
  28. even if a task threw an error. 'run-p' itself
  29. will exit with non-zero code if one or more tasks
  30. threw error(s).
  31. --max-parallel <number> - Set the maximum number of parallelism. Default is
  32. unlimited.
  33. --npm-path <string> - - - Set the path to npm. Default is the value of
  34. environment variable npm_execpath.
  35. If the variable is not defined, then it's "npm."
  36. In this case, the "npm" command must be found in
  37. environment variable PATH.
  38. -l, --print-label - - - - Set the flag to print the task name as a prefix
  39. on each line of output. Tools in tasks may stop
  40. coloring their output if this option was given.
  41. -n, --print-name - - - - Set the flag to print the task name before
  42. running each task.
  43. -r, --race - - - - - - - Set the flag to kill all tasks when a task
  44. finished with zero.
  45. -s, --silent - - - - - - Set 'silent' to the log level of npm.
  46. Shorthand aliases can be combined.
  47. For example, '-clns' equals to '-c -l -n -s'.
  48. Examples:
  49. $ run-p watch:**
  50. $ run-p --print-label "build:** -- --watch"
  51. $ run-p -sl "build:** -- --watch"
  52. $ run-p start-server start-browser start-electron
  53. See Also:
  54. https://github.com/mysticatea/npm-run-all#readme
  55. `)
  56. return Promise.resolve(null)
  57. }