build-with-custom-usage.js 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /**
  2. * Module dependencies
  3. */
  4. var flaverr = require('flaverr');
  5. var helpBuildMachine = require('./private/help-build-machine');
  6. /**
  7. * .buildWithCustomUsage()
  8. *
  9. * Return a machine function with a custom usage style.
  10. *
  11. * > See `help-build-machine.js` in this package for details about the various `opts`.
  12. *
  13. * @param {Dictionary} opts
  14. * @property {Dictionary} def
  15. * @property {String?} arginStyle (see `help-build-machine.js` in this package for details)
  16. * @property {String?} execStyle
  17. * @property {String?} arginValidationTactic
  18. * @property {String?} resultValidationTactic
  19. * @property {String?} extraArginsTactic
  20. * @property {String?} extraCallbacksTactic
  21. * @property {Function?} finalAfterExec
  22. * @property {Dictionary?} defaultMeta
  23. *
  24. * @param {Error?} omen
  25. * A custom build-time omen.
  26. * (For a more complete explanation of what an "omen" is,
  27. * see the relevant comments in `build.js`.)
  28. *
  29. * @returns {Function} a callable (aka "wet") machine function, potentially customized.
  30. */
  31. module.exports = function buildWithCustomUsage(opts, omen){
  32. omen = omen || flaverr.omen(buildWithCustomUsage);
  33. return helpBuildMachine(opts, omen);
  34. };