(yargs: Argv)
| 36 | const describe = 'create a device preference' |
| 37 | |
| 38 | const builder = (yargs: Argv): Argv<CommandArgs> => |
| 39 | inputAndOutputItemBuilder(apiOrganizationCommandBuilder(yargs)) |
| 40 | .example([ |
| 41 | [ |
| 42 | '$0 devicepreferences:create', |
| 43 | 'create a new device preference by answering questions', |
| 44 | ], |
| 45 | [ |
| 46 | '$0 devicepreferences:create -d', |
| 47 | 'generate a device preference by answering questions but do not actually create it', |
| 48 | ], |
| 49 | [ |
| 50 | '$0 devicepreferences:create -i dp.json', |
| 51 | 'create a new device preference defined by the file dp.json', |
| 52 | ], |
| 53 | [ |
| 54 | '$0 devicepreferences:create -i dp.json -o dp-saved.json', |
| 55 | 'create a new device preference defined by the file dp.json and write the results to dp-saved.json', |
| 56 | ], |
| 57 | ]) |
| 58 | .epilog(buildEpilog({ command, apiDocs: ['createPreference'] })) |
| 59 | |
| 60 | const getInputFromUser = async (): Promise<DevicePreferenceCreate> => { |
| 61 | const validateName: ValidateFunction<string> = input => !input || input.match(/^[a-z][a-zA-Z0-9]{2,23}$/) |
nothing calls this directly
no test coverage detected