(command: Command)
| 49 | * Options: |
| 50 | * -c, --conflict-strategy STRATEGY |
| 51 | * Conflict strategy applied to all files and folders |
| 52 | * Values: merge, keep-both, replace, skip. |
| 53 | * ... |
| 54 | * ``` |
| 55 | */ |
| 56 | export function printCommandUsage(command: Command) { |
| 57 | console.log('Usage:'); |
| 58 | printCommandSynopsisLine(command); |
| 59 | |
| 60 | if (command.help) { |
| 61 | console.log(''); |
| 62 | wrapText(command.help, 80).forEach((line) => console.log(line)); |
| 63 | } |
| 64 | |
| 65 | const opts = visibleOptions(command); |
| 66 | if (opts.length) { |
| 67 | console.log(''); |
| 68 | console.log('Options:'); |
| 69 | for (const [name, opt] of opts) { |
| 70 | printOptionManualRow(name, opt); |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | const hasPath = command.args?.find((arg) => arg.includes('path')); |
| 75 | if (hasPath) { |
| 76 | printPathsHelp(); |
no test coverage detected