MCPcopy Create free account
hub / github.com/facebook/jscodeshift / getHelpText

Function getHelpText

src/argsParser.js:48–69  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

46}
47
48function getHelpText(options) {
49 const opts = Object.keys(options)
50 .map(k => options[k])
51 .sort((a,b) => a.display_index - b.display_index);
52
53 const text = `
54Usage: jscodeshift [OPTION]... PATH...
55 or: jscodeshift [OPTION]... -t TRANSFORM_PATH PATH...
56 or: jscodeshift [OPTION]... -t URL PATH...
57 or: jscodeshift [OPTION]... --stdin < file_list.txt
58
59Apply transform logic in TRANSFORM_PATH (recursively) to every PATH.
60If --stdin is set, each line of the standard input is used as a path.
61
62Options:
63"..." behind an option means that it can be supplied multiple times.
64All options are also passed to the transformer, which means you can supply custom options that are not listed here.
65
66${opts.map(formatOption).join('\n')}
67`;
68 return text.trimLeft();
69}
70
71function validateOptions(parsedOptions, options) {
72 const errors = [];

Callers 3

validateOptionsFunction · 0.85
callbackFunction · 0.85
parseFunction · 0.85

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…