git ssb

15+

ansuz / dnssb



Commit 5f2aabf4bd31988b96a0669ba348f953d0658862

add 'branch' command, which returns metadata about a record

ansuz committed on 11/3/2016, 9:00:24 PM
Parent: 29028b33c40e7f71c6075b33c3549b10dcb4bf06

Files changed

index.jschanged
index.jsView
@@ -7,20 +7,21 @@
77
88 (function () {
99 if (require.main !== module) { return module.exports = Lib; }
1010
11-var publishHelp = "\tssb-dns publish (previous record key...) name type value (class)";
12-var updateHelp = "\tssb-dns update name type value (class)";
13-var serverHelp = "\tssb-dns server port host";
14-var dumpHelp = "\tssb-dns dump";
11 +var publishHelp = "\tdnssb publish (previous record key...) name type value (class)";
12 +var updateHelp = "\tdnssb update name type value (class)";
13 +var branchHelp = "\tdnssb branch name type (class)";
14 +var serverHelp = "\tdnssb server port host";
15 +var dumpHelp = "\tdnssb dump";
1516
16-
1717 var CLI_Help = function () {
1818 [
1919 "try one of:",
2020 serverHelp,
2121 publishHelp,
2222 updateHelp,
23 + branchHelp,
2324 dumpHelp,
2425 ].forEach(function (m) {
2526 console.log(m);
2627 });
@@ -109,8 +110,35 @@
109110 });
110111 })
111112 }());
112113 break;
114 +
115 +
116 + case 'branch':
117 + (function () {
118 + if (argv.length < 3) {
119 + console.log("Try:");
120 + console.error(branchHelp);
121 + return;
122 + }
123 +
124 + var name = argv[1];
125 + var type = argv[2];
126 + var _class = argv[3];
127 +
128 + Lib.query.branches(name, type, _class, function (err, branches) {
129 + if (!branches.length) {
130 + console.error("No branches found");
131 + process.exit(1);
132 + }
133 + branches.forEach(function (branch) {
134 + console.log(branch);
135 + });
136 +
137 + process.exit(0);
138 + });
139 + }());
140 + break;
113141 default:
114142 CLI_Help();
115143 break;
116144 }

Built with git-ssb-web