Skip to content

Commit 4af45a5

Browse files
committed
Updated to separate domain record display based on whether or not they are system records.
1 parent 16185c8 commit 4af45a5

2 files changed

Lines changed: 22 additions & 2 deletions

File tree

lib/commands/domain/domain.record._js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,16 @@ exports.init = function (cli) {
103103

104104
cli.interaction.formatOutput(records, function (data) {
105105
if (data.length > 0) {
106-
log.table(data, function (row, item) {
106+
var customRecords = data.filter(function (r) {
107+
return !r.system_record;
108+
});
109+
110+
var systemRecords = data.filter(function (r) {
111+
return r.system_record;
112+
});
113+
114+
log.info($('Custom Records:'));
115+
log.table(customRecords, function (row, item) {
107116
//if (options.details) {
108117
row.cell($('Id'), item.id);
109118
//}
@@ -112,6 +121,17 @@ exports.init = function (cli) {
112121
row.cell($('TTL'), item.ttl);
113122
row.cell($('Content'), item.content.length > 50 ? item.content.substr(0,50) + '...' : item.content);
114123
});
124+
log.info('');
125+
log.info($('System Records (cannot be edited):'));
126+
log.table(systemRecords, function (row, item) {
127+
//if (options.details) {
128+
//row.cell($('Id'), item.id);
129+
//}
130+
row.cell($('Type'), item.record_type);
131+
row.cell($('Name'), item.name || context.domain.name);
132+
row.cell($('TTL'), item.ttl);
133+
row.cell($('Content'), item.content.length > 50 ? item.content.substr(0,50) + '...' : item.content);
134+
});
115135
} else {
116136
log.info($('No records defined yet'));
117137
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"contributors": [
55
"Anderly, Adam <adam@anderly.com>"
66
],
7-
"version": "0.2.6",
7+
"version": "0.2.7",
88
"description": "DNSimple Command Line tool",
99
"tags": [
1010
"dnsimple",

0 commit comments

Comments
 (0)