| 1 |
import { program } from "commander"; |
| 2 |
import { addCompletionSpecCommand } from "../../../src"; |
| 3 |
|
| 4 |
program.option( |
| 5 |
"-f, --filename [filename]", |
| 6 |
"The filename to use when reading from stdin. This will be used in source-maps, errors etc." |
| 7 |
); |
| 8 |
program.option("--presets [list]", "A comma-separated list of preset names."); |
| 9 |
program.option("--plugins [list]", "A comma-separated list of plugin names."); |
| 10 |
program.option("--config-file [path]", "Path to a .babelrc file to use."); |
| 11 |
program.option( |
| 12 |
"--env-name [name]", |
| 13 |
"The name of the 'env' to use when loading configs and plugins. " + |
| 14 |
"Defaults to the value of BABEL_ENV, or else NODE_ENV, or else 'development'." |
| 15 |
); |
| 16 |
program.option( |
| 17 |
"--root-mode [mode]", |
| 18 |
"The project-root resolution mode. " + |
| 19 |
"One of 'root' (the default), 'upward', or 'upward-optional'." |
| 20 |
); |
| 21 |
|
| 22 |
program.option("--source-type [script|module]", ""); |
| 23 |
program.option("--no-babelrc", "Whether or not to look up .babelrc and .babelignore files."); |
| 24 |
program.option("--ignore [list]", "List of glob paths to **not** compile."); |
| 25 |
program.option("--only [list]", "List of glob paths to **only** compile."); |
| 26 |
|
| 27 |
program.option( |
| 28 |
"--no-highlight-code", |
| 29 |
"Enable or disable ANSI syntax highlighting of code frames. (on by default)" |
| 30 |
); |
| 31 |
|
| 32 |
program.option("--no-comments", "Write comments to generated output. (true by default)"); |
| 33 |
program.option("--retain-lines", "Retain line numbers. This will result in really ugly code."); |
| 34 |
program.option( |
| 35 |
"--compact [true|false|auto]", |
| 36 |
"Do not include superfluous whitespace characters and line terminators." |
| 37 |
); |
| 38 |
program.option("--minified", "Save as many bytes when printing. (false by default)"); |
| 39 |
program.option( |
| 40 |
"--auxiliary-comment-before [string]", |
| 41 |
"Print a comment before any injected non-user code." |
| 42 |
); |
| 43 |
program.option( |
| 44 |
"--auxiliary-comment-after [string]", |
| 45 |
"Print a comment after any injected non-user code." |
| 46 |
); |
| 47 |
|
| 48 |
program.option("-s, --source-maps [true|false|inline|both]", ""); |
| 49 |
program.option("--source-map-target [string]", "Set `file` on returned source map."); |
| 50 |
program.option("--source-file-name [string]", "Set `sources[0]` on returned source map."); |
| 51 |
program.option("--source-root [filename]", "The root from which all sources are relative."); |
| 52 |
|
| 53 |
program.option( |
| 54 |
"-x, --extensions [extensions]", |
| 55 |
`List of extensions to compile when a directory has been the input. [${[ |
| 56 |
"js", |
| 57 |
"ts", |
| 58 |
"jsx", |
| 59 |
"tsx", |
| 60 |
].join()}]` |
| 61 |
); |
| 62 |
program.option("--keep-file-extension", "Preserve the file extensions of the input files."); |
| 63 |
program.option("-w, --watch", "Recompile files on changes."); |
| 64 |
program.option("--skip-initial-build", "Do not compile files before watching."); |
| 65 |
program.option("-o, --out-file [out]", "Compile all input files into a single file."); |
| 66 |
program.option( |
| 67 |
"-d, --out-dir [out]", |
| 68 |
"Compile an input directory of modules into an output directory." |
| 69 |
); |
| 70 |
program.option( |
| 71 |
"--relative", |
| 72 |
"Compile into an output directory relative to input directory or file. Requires --out-dir [out]" |
| 73 |
); |
| 74 |
|
| 75 |
program.option("-D, --copy-files", "When compiling a directory copy over non-compilable files."); |
| 76 |
program.option( |
| 77 |
"--include-dotfiles", |
| 78 |
"Include dotfiles when compiling and copying non-compilable files." |
| 79 |
); |
| 80 |
program.option("--no-copy-ignored", "Exclude ignored files when copying non-compilable files."); |
| 81 |
|
| 82 |
program.option("--verbose", "Log everything. This option conflicts with --quiet"); |
| 83 |
program.option("--quiet", "Don't log anything. This option conflicts with --verbose"); |
| 84 |
program.option("--delete-dir-on-start", "Delete the out directory before compilation."); |
| 85 |
program.option("--out-file-extension [string]", "Use a specific extension for the output files"); |
| 86 |
|
| 87 |
program.version("7.15.0"); |
| 88 |
program.usage("[options] <files ...>"); |
| 89 |
|
| 90 |
addCompletionSpecCommand(program); |
| 91 |
program.parse(process.argv); |