'triton insts' default output changes

Change default short and --long output of 'triton insts' somewhat
per feedback from Angela.

I also dropped validFields and turned on dottedLookup so you can do
stuff like:
    triton insts -o shortid,name,tags.foo,metadata.root_authorized_keys
This commit is contained in:
Trent Mick 2015-08-31 13:11:31 -07:00
parent e145090c79
commit dfc3e013b6

View File

@ -20,38 +20,18 @@ var validFilters = [
'credentials'
];
// valid output fields to be printed
var validFields = [
'id',
'name',
'type',
'state',
'dataset',
'memory',
'disk',
'ips',
'metadata',
'created',
'updated',
'package',
'image',
'img',
'ago',
'shortid'
];
function do_instances(subcmd, opts, args, callback) {
if (opts.help) {
this.do_help('help', {}, [subcmd], callback);
return;
}
var columns = 'shortid,name,state,type,img,memory,disk,ago'.split(',');
var columns = 'shortid,name,img,state,primaryIp,ago'.split(',');
if (opts.o) {
/* JSSTYLED */
columns = opts.o.trim().split(/\s*,\s*/g);
} else if (opts.long) {
columns[0] = 'id';
columns = 'id,name,img,package,state,primaryIp,created'.split(',');
}
/* JSSTYLED */
var sort = opts.s.trim().split(/\s*,\s*/g);
@ -116,7 +96,7 @@ function do_instances(subcmd, opts, args, callback) {
skipHeader: opts.H,
columns: columns,
sort: sort,
validFields: validFields
dottedLookup: true
});
}
callback();
@ -151,8 +131,8 @@ do_instances.options = [
{
names: ['s'],
type: 'string',
default: 'name',
help: 'Sort on the given fields. Default is "name".',
default: 'created',
help: 'Sort on the given fields. Default is "created".',
helpArg: 'field1,...'
},
{