| 55 | } |
| 56 | |
| 57 | export function getCommandLineArguments(): { |
| 58 | tag: string; |
| 59 | status: VersionSchema['status']; |
| 60 | skipPrompts; |
| 61 | } { |
| 62 | const { |
| 63 | status, |
| 64 | tag, |
| 65 | yes: skipPrompts |
| 66 | } = yargs(hideBin(process.argv)) |
| 67 | .option('tag', { |
| 68 | type: 'string', |
| 69 | description: 'The identifier for the version of the docs to update.', |
| 70 | requiresArg: true, |
| 71 | default: LATEST_TAG |
| 72 | }) |
| 73 | .option('status', { |
| 74 | type: 'string', |
| 75 | choices: ['supported', 'not-supported', 'latest', 'next'], |
| 76 | default: 'latest', |
| 77 | requiresArg: true |
| 78 | }) |
| 79 | .option('yes', { |
| 80 | type: 'boolean', |
| 81 | default: false, |
| 82 | requiresArg: false, |
| 83 | description: 'If set, will skip any prompts.' |
| 84 | }).argv; |
| 85 | |
| 86 | return { |
| 87 | tag: capitalize(tag), |
| 88 | status: tag.toLowerCase().includes('next') ? 'next' : status, |
| 89 | skipPrompts |
| 90 | }; |
| 91 | } |
| 92 | |
| 93 | export function customSemverCompare(a: string, b: string) { |
| 94 | [a, b] = [a.toLowerCase(), b.toLowerCase()]; |