diff --git a/CHANGELOG.md b/CHANGELOG.md index 92cbf956..2fb4b8fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Add the `resin os build-config` method to pass the interactive config step once and reuse the built file for consequent `resin os configure` calls (added the new `--config` param to it), and for `resin device init` (same `--config` param) +- Improve the supported device types listing ### Fixed diff --git a/build/actions/device.js b/build/actions/device.js index 593885de..005a1c03 100644 --- a/build/actions/device.js +++ b/build/actions/device.js @@ -72,10 +72,11 @@ exports.supported = { description: 'list all supported devices', help: 'Use this command to get the list of all supported devices\n\nExamples:\n\n $ resin devices supported', action: function(params, options, done) { - var resin; + var resin, visuals; resin = require('resin-sdk-preconfigured'); - return resin.models.config.getDeviceTypes().each(function(deviceType) { - return console.log(deviceType.slug); + visuals = require('resin-cli-visuals'); + return resin.models.config.getDeviceTypes().then(function(deviceTypes) { + return console.log(visuals.table.horizontal(deviceTypes, ['slug', 'name'])); }).nodeify(done); } }; diff --git a/lib/actions/device.coffee b/lib/actions/device.coffee index c3107c67..660282ae 100644 --- a/lib/actions/device.coffee +++ b/lib/actions/device.coffee @@ -116,8 +116,13 @@ exports.supported = ''' action: (params, options, done) -> resin = require('resin-sdk-preconfigured') - resin.models.config.getDeviceTypes().each (deviceType) -> - console.log(deviceType.slug) + visuals = require('resin-cli-visuals') + + resin.models.config.getDeviceTypes().then (deviceTypes) -> + console.log visuals.table.horizontal deviceTypes, [ + 'slug' + 'name' + ] .nodeify(done) exports.register =