help.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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-s [--help | -h | --version | -v]
  21. $ run-s [OPTIONS] <tasks>
  22. Run given npm-scripts sequentially.
  23. <tasks> : A list of npm-scripts' names and Glob-like patterns.
  24. Options:
  25. -c, --continue-on-error - Set the flag to continue executing subsequent
  26. tasks even if a task threw an error. 'run-s'
  27. itself will exit with non-zero code if one or
  28. more tasks threw error(s).
  29. --npm-path <string> - - - Set the path to npm. Default is the value of
  30. environment variable npm_execpath.
  31. If the variable is not defined, then it's "npm."
  32. In this case, the "npm" command must be found in
  33. environment variable PATH.
  34. -l, --print-label - - - - Set the flag to print the task name as a prefix
  35. on each line of output. Tools in tasks may stop
  36. coloring their output if this option was given.
  37. -n, --print-name - - - - Set the flag to print the task name before
  38. running each task.
  39. -s, --silent - - - - - - Set 'silent' to the log level of npm.
  40. Shorthand aliases can be combined.
  41. For example, '-clns' equals to '-c -l -n -s'.
  42. Examples:
  43. $ run-s build:**
  44. $ run-s lint clean build:**
  45. $ run-s --silent --print-name lint clean build:**
  46. $ run-s -sn lint clean build:**
  47. See Also:
  48. https://github.com/mysticatea/npm-run-all#readme
  49. `)
  50. return Promise.resolve(null)
  51. }