Implement devices supported command

This commit is contained in:
Juan Cruz Viotti 2014-12-24 12:49:49 -04:00
parent 14f047da53
commit af8d1e4517
3 changed files with 22 additions and 2 deletions

View File

@ -10,6 +10,10 @@ _resin() {
local subcommands="create rm restart"
COMPREPLY=( $(compgen -W "${subcommands}" -- ${current}) )
return 0 ;;
devices)
local subcommands="supported"
COMPREPLY=( $(compgen -W "${subcommands}" -- ${current}) )
return 0 ;;
device)
local subcommands="rename rm identify"
COMPREPLY=( $(compgen -W "${subcommands}" -- ${current}) )

View File

@ -1,4 +1,4 @@
_ = require('lodash')
_ = require('lodash-contrib')
async = require('async')
resin = require('../resin')
ui = require('../ui')
@ -72,3 +72,7 @@ exports.rename = permissions.user (params) ->
], (error) ->
errors.handle(error) if error?
exports.supported = permissions.user ->
devices = resin.models.device.getSupportedDeviceTypes()
_.each(devices, _.unary(log.out))

View File

@ -136,7 +136,8 @@ capitano.command
You can specify the application type with the `--type` option.
Otherwise, an interactive dropdown will be shown for you to select from.
TODO: We should support a command to list all supported device types.
You can see a list of supported device types with
$ resin devices supported
Examples:
$ resin app create MyApp
@ -231,6 +232,17 @@ capitano.command
action: actions.device.list
options: [ applicationOption ]
capitano.command
signature: 'devices supported'
description: 'list all supported devices'
help: '''
Use this command to get the list of all supported devices
Examples:
$ resin devices supported
'''
action: actions.device.supported
capitano.command
signature: 'device rename <id> [name]'
description: 'rename a resin device'