Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
executable file 58 lines (43 sloc) 1.2 KB
#!/usr/bin/env node
// -*- mode: js -*-
// vim: set filetype=javascript :
// Copyright 2012 Joyent, Inc. All rights reserved.
var path = require('path');
var url = require('url');
var common = require('../lib/cli_common');
///--- Globals
var Options = {
"account": String,
"debug": Boolean,
"help": Boolean,
"identity": path,
"keyId": String,
"machine": String,
"url": url
};
var ShortOptions = {
"a": ["--account"],
"d": ["--debug"],
"h": ["--help"],
"?": ["--help"],
"i": ["--identity"],
"k": ["--keyId"],
"m": ["--machine"],
"u": ["--url"]
};
var usageStr = common.buildUsageString(Options) + ' tag (use * to delete all)';
///--- Mainline
common.parseArguments(Options, ShortOptions, function(parsed) {
if (!parsed.machine)
common.usage(usageStr, 1, 'machine required');
if (parsed.argv.remain.length < 1)
common.usage(usageStr, 1, 'snapshot required');
var client = common.newClient(parsed);
if (parsed.argv.remain[0] === '*') {
return client.deleteMachineTags(parsed.machine, common.callback);
} else {
return parsed.argv.remain.forEach(function(tag) {
client.deleteMachineTag(parsed.machine, tag, common.callback);
});
}
}, usageStr);
Jump to Line
Something went wrong with that request. Please try again.