From dfc3e013b617b3e249fcb8aa5a5e364ca32e346e Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Mon, 31 Aug 2015 13:11:31 -0700 Subject: [PATCH] '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 --- lib/do_instances.js | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/lib/do_instances.js b/lib/do_instances.js index ac6947c..d7ae0e0 100644 --- a/lib/do_instances.js +++ b/lib/do_instances.js @@ -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,...' }, {