Make sure everything uses the same shared deviceApiKey option

This commit is contained in:
Tim Perry 2017-11-16 19:09:20 +01:00
parent 7e306fbce8
commit 08c40195e5
7 changed files with 18 additions and 25 deletions

View File

@ -44,6 +44,13 @@ exports.optionalDevice = {
alias: 'd' alias: 'd'
}; };
exports.optionalDeviceApiKey = {
signature: 'deviceApiKey',
description: 'custom device key - note that this is only supported on ResinOS 2.0.3+',
parameter: 'device-api-key',
alias: 'k'
};
exports.booleanDevice = { exports.booleanDevice = {
signature: 'device', signature: 'device',
description: 'device', description: 'device',

View File

@ -196,12 +196,7 @@ exports.generate = {
description: 'generate a config.json file', description: 'generate a config.json file',
help: 'Use this command to generate a config.json for a device or application.\n\nThis is interactive by default, but you can do this automatically without interactivity\nby specifying an option for each question on the command line, if you know the questions\nthat will be asked for the relevant device type.\n\nExamples:\n\n $ resin config generate --device 7cf02a6\n $ resin config generate --device 7cf02a6 --device-api-key <existingDeviceKey>\n $ resin config generate --device 7cf02a6 --output config.json\n $ resin config generate --app MyApp\n $ resin config generate --app MyApp --output config.json\n $ resin config generate --app MyApp --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 1', help: 'Use this command to generate a config.json for a device or application.\n\nThis is interactive by default, but you can do this automatically without interactivity\nby specifying an option for each question on the command line, if you know the questions\nthat will be asked for the relevant device type.\n\nExamples:\n\n $ resin config generate --device 7cf02a6\n $ resin config generate --device 7cf02a6 --device-api-key <existingDeviceKey>\n $ resin config generate --device 7cf02a6 --output config.json\n $ resin config generate --app MyApp\n $ resin config generate --app MyApp --output config.json\n $ resin config generate --app MyApp --network wifi --wifiSsid mySsid --wifiKey abcdefgh --appUpdatePollInterval 1',
options: [ options: [
commandOptions.optionalApplication, commandOptions.optionalDevice, { commandOptions.optionalApplication, commandOptions.optionalDevice, commandOptions.optionalDeviceApiKey, {
signature: 'deviceApiKey',
description: 'custom device key - note that this is only supported on ResinOS 2.0.3+',
parameter: 'device-api-key',
alias: 'k'
}, {
signature: 'output', signature: 'output',
description: 'output', description: 'output',
parameter: 'output', parameter: 'output',

View File

@ -92,12 +92,7 @@ exports.register = {
description: 'custom uuid', description: 'custom uuid',
parameter: 'uuid', parameter: 'uuid',
alias: 'u' alias: 'u'
}, { }, commandOptions.optionalDeviceApiKey
signature: 'deviceApiKey',
description: 'custom device key',
parameter: 'device-api-key',
alias: 'k'
}
], ],
action: function(params, options, done) { action: function(params, options, done) {
var Promise, ref, ref1, resin; var Promise, ref, ref1, resin;

View File

@ -350,7 +350,7 @@ custom uuid
#### --deviceApiKey, -k &#60;device-api-key&#62; #### --deviceApiKey, -k &#60;device-api-key&#62;
custom device key custom device key - note that this is only supported on ResinOS 2.0.3+
## device rm &#60;uuid&#62; ## device rm &#60;uuid&#62;

View File

@ -38,6 +38,12 @@ exports.optionalDevice =
description: 'device uuid' description: 'device uuid'
alias: 'd' alias: 'd'
exports.optionalDeviceApiKey =
signature: 'deviceApiKey'
description: 'custom device key - note that this is only supported on ResinOS 2.0.3+'
parameter: 'device-api-key'
alias: 'k'
exports.booleanDevice = exports.booleanDevice =
signature: 'device' signature: 'device'
description: 'device' description: 'device'

View File

@ -237,12 +237,7 @@ exports.generate =
options: [ options: [
commandOptions.optionalApplication commandOptions.optionalApplication
commandOptions.optionalDevice commandOptions.optionalDevice
{ commandOptions.optionalDeviceApiKey
signature: 'deviceApiKey'
description: 'custom device key - note that this is only supported on ResinOS 2.0.3+'
parameter: 'device-api-key'
alias: 'k'
}
{ {
signature: 'output' signature: 'output'
description: 'output' description: 'output'

View File

@ -147,12 +147,7 @@ exports.register =
parameter: 'uuid' parameter: 'uuid'
alias: 'u' alias: 'u'
} }
{ commandOptions.optionalDeviceApiKey
signature: 'deviceApiKey'
description: 'custom device key'
parameter: 'device-api-key'
alias: 'k'
}
] ]
action: (params, options, done) -> action: (params, options, done) ->
Promise = require('bluebird') Promise = require('bluebird')