MCPcopy Create free account
hub / github.com/ProtonDriveApps/sdk / printCommandUsage

Function printCommandUsage

cli/src/cli/help.ts:51–73  ·  view source on GitHub ↗
(command: Command)

Source from the content-addressed store, hash-verified

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 */
56export 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();

Callers 3

runCommandFunction · 0.90
getCommandArgumentsFunction · 0.90
validateCommandArgumentsFunction · 0.90

Calls 6

printCommandSynopsisLineFunction · 0.85
wrapTextFunction · 0.85
visibleOptionsFunction · 0.85
printOptionManualRowFunction · 0.85
printPathsHelpFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected