From a715ec9dc15bbb1943e7b08d6f5168fb9b6a28de Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Tue, 4 Aug 2015 09:54:54 -0400 Subject: [PATCH] Remove drive command --- build/actions/drive.js | 33 ---------------- build/actions/index.js | 1 - build/app.js | 2 - capitanodoc.json | 12 ------ doc/cli.markdown | 84 ++++++++++------------------------------ lib/actions/drive.coffee | 32 --------------- lib/actions/index.coffee | 1 - lib/app.coffee | 3 -- 8 files changed, 20 insertions(+), 148 deletions(-) delete mode 100644 build/actions/drive.js delete mode 100644 lib/actions/drive.coffee diff --git a/build/actions/drive.js b/build/actions/drive.js deleted file mode 100644 index c31ca74f..00000000 --- a/build/actions/drive.js +++ /dev/null @@ -1,33 +0,0 @@ -(function() { - var _, async, drivelist, visuals; - - _ = require('lodash'); - - async = require('async'); - - visuals = require('resin-cli-visuals'); - - drivelist = require('drivelist'); - - exports.list = { - signature: 'drives', - description: 'list available drives', - help: 'Use this command to list all drives that are connected to your machine.\n\nExamples:\n\n $ resin drives', - permission: 'user', - action: function(params, options, done) { - return drivelist.list(function(error, drives) { - if (error != null) { - return done(error); - } - return async.reject(drives, drivelist.isSystem, function(removableDrives) { - if (_.isEmpty(removableDrives)) { - return done(new Error('No removable devices available')); - } - console.log(visuals.table.horizontal(removableDrives, ['device', 'description', 'size'])); - return done(); - }); - }); - } - }; - -}).call(this); diff --git a/build/actions/index.js b/build/actions/index.js index f09ebe6b..5393558e 100644 --- a/build/actions/index.js +++ b/build/actions/index.js @@ -3,7 +3,6 @@ app: require('./app'), info: require('./info'), auth: require('./auth'), - drive: require('./drive'), device: require('./device'), env: require('./environment-variables'), keys: require('./keys'), diff --git a/build/app.js b/build/app.js index a10d91cf..be03684a 100644 --- a/build/app.js +++ b/build/app.js @@ -103,8 +103,6 @@ capitano.command(actions.device.identify); - capitano.command(actions.drive.list); - capitano.command(actions.notes.set); capitano.command(actions.preferences.preferences); diff --git a/capitanodoc.json b/capitanodoc.json index 0f913224..d15bf099 100644 --- a/capitanodoc.json +++ b/capitanodoc.json @@ -20,12 +20,6 @@ "lib/actions/device.coffee" ] }, - { - "title": "Drive", - "files": [ - "lib/actions/drive.coffee" - ] - }, { "title": "Environment Variables", "files": [ @@ -79,12 +73,6 @@ "files": [ "lib/actions/preferences.coffee" ] - }, - { - "title": "Update", - "files": [ - "lib/actions/update.coffee" - ] } ] } diff --git a/doc/cli.markdown b/doc/cli.markdown index 1a7d5c88..f6e3d4bc 100644 --- a/doc/cli.markdown +++ b/doc/cli.markdown @@ -34,18 +34,14 @@ Now you have access to all the commands referenced below. - Device - [devices](#devices) - - [device <name>](#device-60-name-62-) - - [device rm <name>](#device-rm-60-name-62-) + - [device <uuid>](#device-60-uuid-62-) + - [device rm <uuid>](#device-rm-60-uuid-62-) - [device identify <uuid>](#device-identify-60-uuid-62-) - - [device rename <name> [newName]](#device-rename-60-name-62-newname-) + - [device rename <uuid> [newName]](#device-rename-60-uuid-62-newname-) - [devices supported](#devices-supported) - - [device await <name>](#device-await-60-name-62-) + - [device await <uuid>](#device-await-60-uuid-62-) - [device init [device]](#device-init-device-) -- Drive - - - [drives](#drives) - - Environment Variables - [envs](#envs) @@ -94,10 +90,6 @@ Now you have access to all the commands referenced below. - [preferences](#preferences) -- Update - - - [update](#update) - # Application ## app create <name> @@ -285,15 +277,15 @@ Examples: application name -## device <name> +## device <uuid> Use this command to show information about a single device. Examples: - $ resin device MyDevice + $ resin device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 -## device rm <name> +## device rm <uuid> Use this command to remove a device from resin.io. @@ -302,8 +294,8 @@ You can avoid this by passing the `--yes` boolean option. Examples: - $ resin device rm MyDevice - $ resin device rm MyDevice --yes + $ resin device rm 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 + $ resin device rm 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 --yes ### Options @@ -321,7 +313,7 @@ Examples: $ resin device identify 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 -## device rename <name> [newName] +## device rename <uuid> [newName] Use this command to rename a device. @@ -329,8 +321,8 @@ If you omit the name, you'll get asked for it interactively. Examples: - $ resin device rename MyDevice MyPi - $ resin device rename MyDevice + $ resin device rename 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 MyPi + $ resin device rename 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 ## devices supported @@ -340,7 +332,7 @@ Examples: $ resin devices supported -## device await <name> +## device await <uuid> Use this command to await for a device to become online. @@ -352,8 +344,8 @@ You can configure the poll interval with the --interval option (defaults to 3000 Examples: - $ resin device await MyDevice - $ resin device await MyDevice --interval 1000 + $ resin device await 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 + $ resin device await 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 --interval 1000 ### Options @@ -410,16 +402,6 @@ wifi ssid, if network is wifi wifi key, if network is wifi -# Drive - -## drives - -Use this command to list all drives that are connected to your machine. - -Examples: - - $ resin drives - # Environment Variables ## envs @@ -435,7 +417,7 @@ Example: $ resin envs --application MyApp $ resin envs --application MyApp --verbose - $ resin envs --device MyDevice + $ resin envs --device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 ### Options @@ -632,9 +614,6 @@ Use this command to show logs for a specific device. By default, the command prints all log messages and exit. -To limit the output to the n last lines, use the `--num` option along with a number. -This is similar to doing `resin logs | tail -n X`. - To continuously stream output, and see new logs in real time, use the `--tail` option. Note that for now you need to provide the whole UUID for this command to work correctly. @@ -644,15 +623,10 @@ This is due to some technical limitations that we plan to address soon. Examples: $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 - $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --num 20 $ resin logs 23c73a12e3527df55c60b9ce647640c1b7da1b32d71e6a39849ac0f00db828 --tail ### Options -#### --num, -n <num> - -number of lines to display - #### --tail, -t continuously stream output @@ -665,18 +639,18 @@ Use this command to set or update a device note. If note command isn't passed, the tool attempts to read from `stdin`. -To view the notes, use $ resin device . +To view the notes, use $ resin device . Examples: - $ resin note "My useful note" --device MyDevice - $ cat note.txt | resin note --device MyDevice + $ resin note "My useful note" --device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 + $ cat note.txt | resin note --device 7cf02a62a3a84440b1bb5579a3d57469148943278630b17e7fc6c4f7b465c9 ### Options #### --device, --d,dev, --d,dev <device> -device name +device uuid # Plugin @@ -739,21 +713,3 @@ Examples: $ resin preferences -# Update - -## update - -Use this command to update the Resin CLI - -This command outputs information about the update process. -Use `--quiet` to remove that output. - -The Resin CLI checks for updates once per day. - -Major updates require a manual update with this update command, -while minor updates are applied automatically. - -Examples: - - $ resin update - diff --git a/lib/actions/drive.coffee b/lib/actions/drive.coffee deleted file mode 100644 index ee76b5d2..00000000 --- a/lib/actions/drive.coffee +++ /dev/null @@ -1,32 +0,0 @@ -_ = require('lodash') -async = require('async') -visuals = require('resin-cli-visuals') -drivelist = require('drivelist') - -exports.list = - signature: 'drives' - description: 'list available drives' - help: ''' - Use this command to list all drives that are connected to your machine. - - Examples: - - $ resin drives - ''' - permission: 'user' - action: (params, options, done) -> - drivelist.list (error, drives) -> - return done(error) if error? - - async.reject drives, drivelist.isSystem, (removableDrives) -> - - if _.isEmpty(removableDrives) - return done(new Error('No removable devices available')) - - console.log visuals.table.horizontal removableDrives, [ - 'device' - 'description' - 'size' - ] - - return done() diff --git a/lib/actions/index.coffee b/lib/actions/index.coffee index eed70bb8..b534a829 100644 --- a/lib/actions/index.coffee +++ b/lib/actions/index.coffee @@ -2,7 +2,6 @@ module.exports = app: require('./app') info: require('./info') auth: require('./auth') - drive: require('./drive') device: require('./device') env: require('./environment-variables') keys: require('./keys') diff --git a/lib/app.coffee b/lib/app.coffee index 936a37d2..b979f983 100644 --- a/lib/app.coffee +++ b/lib/app.coffee @@ -76,9 +76,6 @@ capitano.command(actions.device.info) capitano.command(actions.device.remove) capitano.command(actions.device.identify) -# ---------- Drive Module ---------- -capitano.command(actions.drive.list) - # ---------- Notes Module ---------- capitano.command(actions.notes.set)