cli-options.js 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. 'use strict';
  2. var ansi = require('./ansi');
  3. module.exports = {
  4. help: {
  5. alias: 'h',
  6. type: 'boolean',
  7. desc: ansi.gray(
  8. 'Show this help.'),
  9. },
  10. version: {
  11. alias: 'v',
  12. type: 'boolean',
  13. desc: ansi.gray(
  14. 'Print the global and local gulp versions.'),
  15. },
  16. require: {
  17. type: 'string',
  18. requiresArg: true,
  19. desc: ansi.gray(
  20. 'Will require a module before running the gulpfile. ' +
  21. 'This is useful for transpilers but also has other applications.'),
  22. },
  23. gulpfile: {
  24. alias: 'f',
  25. type: 'string',
  26. requiresArg: true,
  27. desc: ansi.gray(
  28. 'Manually set path of gulpfile. Useful if you have multiple gulpfiles. ' +
  29. 'This will set the CWD to the gulpfile directory as well.'),
  30. },
  31. cwd: {
  32. type: 'string',
  33. requiresArg: true,
  34. desc: ansi.gray(
  35. 'Manually set the CWD. The search for the gulpfile, ' +
  36. 'as well as the relativity of all requires will be from here.'),
  37. },
  38. verify: {
  39. desc: ansi.gray(
  40. 'Will verify plugins referenced in project\'s package.json against ' +
  41. 'the plugins blacklist.'),
  42. },
  43. tasks: {
  44. alias: 'T',
  45. type: 'boolean',
  46. desc: ansi.gray(
  47. 'Print the task dependency tree for the loaded gulpfile.'),
  48. },
  49. 'tasks-simple': {
  50. type: 'boolean',
  51. desc: ansi.gray(
  52. 'Print a plaintext list of tasks for the loaded gulpfile.'),
  53. },
  54. 'tasks-json': {
  55. desc: ansi.gray(
  56. 'Print the task dependency tree, ' +
  57. 'in JSON format, for the loaded gulpfile.'),
  58. },
  59. 'tasks-depth': {
  60. alias: 'depth',
  61. type: 'number',
  62. requiresArg: true,
  63. desc: ansi.gray(
  64. 'Specify the depth of the task dependency tree.'),
  65. },
  66. 'compact-tasks': {
  67. type: 'boolean',
  68. desc: ansi.gray(
  69. 'Reduce the output of task dependency tree by printing ' +
  70. 'only top tasks and their child tasks.'),
  71. },
  72. 'sort-tasks': {
  73. type: 'boolean',
  74. desc: ansi.gray(
  75. 'Will sort top tasks of task dependency tree.'),
  76. },
  77. color: {
  78. type: 'boolean',
  79. desc: ansi.gray(
  80. 'Will force gulp and gulp plugins to display colors, ' +
  81. 'even when no color support is detected.'),
  82. },
  83. 'no-color': {
  84. type: 'boolean',
  85. desc: ansi.gray(
  86. 'Will force gulp and gulp plugins to not display colors, ' +
  87. 'even when color support is detected.'),
  88. },
  89. silent: {
  90. alias: 'S',
  91. type: 'boolean',
  92. desc: ansi.gray(
  93. 'Suppress all gulp logging.'),
  94. },
  95. continue: {
  96. type: 'boolean',
  97. desc: ansi.gray(
  98. 'Continue execution of tasks upon failure.'),
  99. },
  100. series: {
  101. type: 'boolean',
  102. desc: ansi.gray(
  103. 'Run tasks given on the CLI in series (the default is parallel).'),
  104. },
  105. 'log-level': {
  106. alias: 'L',
  107. // Type isn't needed because count acts as a boolean
  108. count: true,
  109. // Can't use `default` because it seems to be off by one
  110. desc: ansi.gray(
  111. 'Set the loglevel. -L for least verbose and -LLLL for most verbose. ' +
  112. '-LLL is default.'),
  113. },
  114. };