optionDefinitions.js 918 B

123456789101112131415161718192021222324252627282930313233343536
  1. 'use strict';
  2. const pkg = require('../package.json');
  3. /* eslint-disable jsdoc/require-property -- Schema is already below */
  4. /**
  5. * @typedef {PlainObject} CoveradgeOptions
  6. */
  7. /* eslint-enable jsdoc/require-property -- Schema is already below */
  8. const optionDefinitions = [
  9. {
  10. name: 'date', alias: 'd', type: String, defaultOption: true,
  11. description: 'Gregorian date (parseable by `Date`) to convert to ' +
  12. 'Badí\' date (or empty to get today\'s date).',
  13. typeLabel: '{underline date}'
  14. },
  15. {
  16. name: 'verbose', type: Boolean,
  17. description: 'Whether to provide an entire JSON object with full details.'
  18. }
  19. ];
  20. const cliSections = [
  21. {
  22. // Add italics: `{italic textToItalicize}`
  23. content: pkg.description +
  24. '\n\n{italic bahai-date [--verbose] [aDate]}'
  25. },
  26. {
  27. optionList: optionDefinitions
  28. }
  29. ];
  30. exports.definitions = optionDefinitions;
  31. exports.sections = cliSections;