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.

85 lines
2.9 KiB

8 years ago
9 years ago
9 years ago
8 years ago
8 years ago
  1. exports.definitions = [
  2. {
  3. name: 'port', alias: 'p', type: Number, defaultOption: true,
  4. description: 'Web server port.', group: 'server'
  5. },
  6. {
  7. name: 'directory', alias: 'd', type: String, typeLabel: '[underline]{path}',
  8. description: 'Root directory, defaults to the current directory.', group: 'server'
  9. },
  10. {
  11. name: 'log-format', alias: 'f', type: String,
  12. description: "If a format is supplied an access log is written to stdout. If not, a dynamic statistics view is displayed. Use a preset ('none', 'dev','combined', 'short', 'tiny' or 'logstalgia') or supply a custom format (e.g. ':method -> :url').", group: 'server'
  13. },
  14. {
  15. name: 'rewrite', alias: 'r', type: String, multiple: true, typeLabel: '[underline]{expression} ...',
  16. description: "A list of URL rewrite rules. For each rule, separate the 'from' and 'to' routes with '->'. Whitespace surrounded the routes is ignored. E.g. '/from -> /to'.", group: 'server'
  17. },
  18. {
  19. name: 'spa', alias: 's', type: String, typeLabel: '[underline]{file}',
  20. description: 'Path to a Single Page App, e.g. app.html.', group: 'server'
  21. },
  22. {
  23. name: 'compress', alias: 'c', type: Boolean,
  24. description: 'Serve gzip-compressed resources, where applicable.', group: 'server'
  25. },
  26. {
  27. name: 'forbid', alias: 'b', type: String, multiple: true, typeLabel: '[underline]{path} ...',
  28. description: 'A list of forbidden routes.', group: 'server'
  29. },
  30. {
  31. name: 'no-cache', alias: 'n', type: Boolean,
  32. description: 'Disable etag-based caching - forces loading from disk each request.', group: 'server'
  33. },
  34. {
  35. name: 'key', type: String, typeLabel: '[underline]{file}', group: 'server',
  36. description: 'SSL key. Supply along with --cert to launch a https server.'
  37. },
  38. {
  39. name: 'cert', type: String, typeLabel: '[underline]{file}', group: 'server',
  40. description: 'SSL cert. Supply along with --key to launch a https server.'
  41. },
  42. {
  43. name: 'https', type: Boolean, group: 'server',
  44. description: 'Enable HTTPS using a built-in key and cert, registered to the domain 127.0.0.1.'
  45. },
  46. {
  47. name: 'verbose', type: Boolean,
  48. description: 'Verbose output, useful for debugging.', group: 'server'
  49. },
  50. {
  51. name: 'help', alias: 'h', type: Boolean,
  52. description: 'Print these usage instructions.', group: 'misc'
  53. },
  54. {
  55. name: 'config', type: Boolean,
  56. description: 'Print the stored config.', group: 'misc'
  57. }
  58. ]
  59. exports.usageData = [
  60. {
  61. header: 'local-web-server',
  62. content: 'A simple web-server for productive front-end development.'
  63. },
  64. {
  65. header: 'Usage',
  66. content: [
  67. '$ ws [<server options>]',
  68. '$ ws --config',
  69. '$ ws --help'
  70. ]
  71. },
  72. {
  73. header: 'Server',
  74. optionList: exports.definitions,
  75. group: 'server'
  76. },
  77. {
  78. header: 'Misc',
  79. optionList: exports.definitions,
  80. group: 'misc'
  81. },
  82. {
  83. content: 'Project home: [underline]{https://github.com/75lb/local-web-server}'
  84. }
  85. ]