cli-options.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. default: undefined, // To detect if this cli option is specified.
  64. desc: ansi.gray(
  65. 'Specify the depth of the task dependency tree.'),
  66. },
  67. 'compact-tasks': {
  68. type: 'boolean',
  69. default: undefined, // To detect if this cli option is specified.
  70. desc: ansi.gray(
  71. 'Reduce the output of task dependency tree by printing ' +
  72. 'only top tasks and their child tasks.'),
  73. },
  74. 'sort-tasks': {
  75. type: 'boolean',
  76. default: undefined, // To detect if this cli option is specified.
  77. desc: ansi.gray(
  78. 'Will sort top tasks of task dependency tree.'),
  79. },
  80. color: {
  81. type: 'boolean',
  82. desc: ansi.gray(
  83. 'Will force gulp and gulp plugins to display colors, ' +
  84. 'even when no color support is detected.'),
  85. },
  86. 'no-color': {
  87. type: 'boolean',
  88. desc: ansi.gray(
  89. 'Will force gulp and gulp plugins to not display colors, ' +
  90. 'even when color support is detected.'),
  91. },
  92. silent: {
  93. alias: 'S',
  94. type: 'boolean',
  95. default: undefined, // To detect if this cli option is specified.
  96. desc: ansi.gray(
  97. 'Suppress all gulp logging.'),
  98. },
  99. continue: {
  100. type: 'boolean',
  101. default: undefined, // To detect if this cli option is specified.
  102. desc: ansi.gray(
  103. 'Continue execution of tasks upon failure.'),
  104. },
  105. series: {
  106. type: 'boolean',
  107. default: undefined, // To detect if this cli option is specified.
  108. desc: ansi.gray(
  109. 'Run tasks given on the CLI in series (the default is parallel).'),
  110. },
  111. 'log-level': {
  112. alias: 'L',
  113. // Type isn't needed because count acts as a boolean
  114. count: true,
  115. default: undefined, // To detect if this cli option is specified.
  116. desc: ansi.gray(
  117. 'Set the loglevel. -L for least verbose and -LLLL for most verbose. ' +
  118. '-LLL is default.'),
  119. },
  120. };