(argv: Argv<object>)
| 36 | } |
| 37 | |
| 38 | function buildCommandOptions(argv: Argv<object>): Argv<object> { |
| 39 | return addTaskParameterMiddleware( |
| 40 | argv |
| 41 | .positional('files', { |
| 42 | description: 'Path(s) to file(s) to make available under /input/' |
| 43 | }) |
| 44 | .option('engine', { |
| 45 | choices: ['ffmpeg', 'imagemagick', 'graphicsmagick'] as const, |
| 46 | describe: 'Set the command execution engine', |
| 47 | demandOption: true |
| 48 | }) |
| 49 | .option('command', { |
| 50 | describe: 'Set the executable command, such as ffmpeg', |
| 51 | type: 'string', |
| 52 | demandOption: true |
| 53 | }) |
| 54 | .option('arguments', { |
| 55 | describe: 'Set the command arguments. Use /input/upload-0/ and /output/ paths', |
| 56 | type: 'string', |
| 57 | demandOption: true |
| 58 | }) |
| 59 | .option('capture-output', { |
| 60 | describe: 'Capture and print command output', |
| 61 | type: 'boolean', |
| 62 | default: true |
| 63 | }) |
| 64 | .example( |
| 65 | 'cloudconvert command --engine=ffmpeg --command=ffmpeg --arguments="-i /input/upload-0/input.mp4 -vcodec libx264 -acodec copy /output/output.mp4" input.mp4', |
| 66 | '' |
| 67 | ) |
| 68 | .example( |
| 69 | 'cloudconvert command --engine=imagemagick --command=convert --arguments="/input/upload-0/input.png -resize 50% /output/output.png" input.png', |
| 70 | '' |
| 71 | ) |
| 72 | ) |
| 73 | .help() |
| 74 | .hide('version') |
| 75 | .epilogue('Find possible task parameters with: cloudconvert parameters command'); |
| 76 | } |
no test coverage detected