diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..bebde4c
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,88 @@
+# Change Log
+
+## [v1.2.2](https://github.com/azuqua/clusterluck/tree/v1.2.2) (2017-06-16)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.2.1...v1.2.2)
+
+**Merged pull requests:**
+
+- bug fixes for AOF load, updated tests to reflect changes [\#32](https://github.com/azuqua/clusterluck/pull/32) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#31](https://github.com/azuqua/clusterluck/pull/31) ([kevinwilson541](https://github.com/kevinwilson541))
+
+## [v1.2.1](https://github.com/azuqua/clusterluck/tree/v1.2.1) (2017-06-09)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.2.0...v1.2.1)
+
+**Merged pull requests:**
+
+- Develop [\#30](https://github.com/azuqua/clusterluck/pull/30) ([kevinwilson541](https://github.com/kevinwilson541))
+- add dtable as available class/creator function in index.js [\#29](https://github.com/azuqua/clusterluck/pull/29) ([kevinwilson541](https://github.com/kevinwilson541))
+
+## [v1.2.0](https://github.com/azuqua/clusterluck/tree/v1.2.0) (2017-06-09)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.1.4...v1.2.0)
+
+**Merged pull requests:**
+
+- Added examples for gen\_servers, dtable module for persistent in-memory key/value storage [\#28](https://github.com/azuqua/clusterluck/pull/28) ([kevinwilson541](https://github.com/kevinwilson541))
+- keep data directory for tests [\#27](https://github.com/azuqua/clusterluck/pull/27) ([kevinwilson541](https://github.com/kevinwilson541))
+- add more documentation to dtable class [\#25](https://github.com/azuqua/clusterluck/pull/25) ([kevinwilson541](https://github.com/kevinwilson541))
+- add disk-based table using AOF+snapshot persistence model \(for future… [\#24](https://github.com/azuqua/clusterluck/pull/24) ([kevinwilson541](https://github.com/kevinwilson541))
+- fix dlm example to reference data.holder correctly on lock timeout [\#23](https://github.com/azuqua/clusterluck/pull/23) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#22](https://github.com/azuqua/clusterluck/pull/22) ([kevinwilson541](https://github.com/kevinwilson541))
+
+## [v1.1.4](https://github.com/azuqua/clusterluck/tree/v1.1.4) (2017-04-26)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.1.3...v1.1.4)
+
+**Merged pull requests:**
+
+- Develop [\#21](https://github.com/azuqua/clusterluck/pull/21) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#20](https://github.com/azuqua/clusterluck/pull/20) ([kevinwilson541](https://github.com/kevinwilson541))
+- update vector clock constants to fix milli/micro error [\#19](https://github.com/azuqua/clusterluck/pull/19) ([kevinwilson541](https://github.com/kevinwilson541))
+- Update Gruntfile.js [\#18](https://github.com/azuqua/clusterluck/pull/18) ([aembke](https://github.com/aembke))
+
+## [v1.1.3](https://github.com/azuqua/clusterluck/tree/v1.1.3) (2017-04-14)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.1.2...v1.1.3)
+
+**Merged pull requests:**
+
+- Develop [\#17](https://github.com/azuqua/clusterluck/pull/17) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#16](https://github.com/azuqua/clusterluck/pull/16) ([kevinwilson541](https://github.com/kevinwilson541))
+
+## [v1.1.2](https://github.com/azuqua/clusterluck/tree/v1.1.2) (2017-03-30)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.1.1...v1.1.2)
+
+**Merged pull requests:**
+
+- Develop [\#15](https://github.com/azuqua/clusterluck/pull/15) ([kevinwilson541](https://github.com/kevinwilson541))
+- remove TODOs from CLI and update README with patch [\#14](https://github.com/azuqua/clusterluck/pull/14) ([kevinwilson541](https://github.com/kevinwilson541))
+
+## [v1.1.1](https://github.com/azuqua/clusterluck/tree/v1.1.1) (2017-03-29)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.1.0...v1.1.1)
+
+**Merged pull requests:**
+
+- Develop [\#13](https://github.com/azuqua/clusterluck/pull/13) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#12](https://github.com/azuqua/clusterluck/pull/12) ([kevinwilson541](https://github.com/kevinwilson541))
+
+## [v1.1.0](https://github.com/azuqua/clusterluck/tree/v1.1.0) (2017-03-29)
+[Full Changelog](https://github.com/azuqua/clusterluck/compare/v1.0.0...v1.1.0)
+
+**Merged pull requests:**
+
+- v1.1.0 commits for documentation and GenServer request timeouts [\#11](https://github.com/azuqua/clusterluck/pull/11) ([kevinwilson541](https://github.com/kevinwilson541))
+- Enhanced documentation, added request timeouts GenServer side [\#10](https://github.com/azuqua/clusterluck/pull/10) ([kevinwilson541](https://github.com/kevinwilson541))
+- don't need to overwrite path to index in docs [\#9](https://github.com/azuqua/clusterluck/pull/9) ([aembke](https://github.com/aembke))
+- back to sudo [\#8](https://github.com/azuqua/clusterluck/pull/8) ([aembke](https://github.com/aembke))
+- no sudo [\#7](https://github.com/azuqua/clusterluck/pull/7) ([aembke](https://github.com/aembke))
+- docs, travis, coveralls [\#6](https://github.com/azuqua/clusterluck/pull/6) ([aembke](https://github.com/aembke))
+
+## [v1.0.0](https://github.com/azuqua/clusterluck/tree/v1.0.0) (2017-03-24)
+**Merged pull requests:**
+
+- v0.0.1 [\#5](https://github.com/azuqua/clusterluck/pull/5) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#4](https://github.com/azuqua/clusterluck/pull/4) ([kevinwilson541](https://github.com/kevinwilson541))
+- changes to command server to preserve message tag, cli under bin dire… [\#3](https://github.com/azuqua/clusterluck/pull/3) ([kevinwilson541](https://github.com/kevinwilson541))
+- command server for impending cli tool for cluster management, tests [\#2](https://github.com/azuqua/clusterluck/pull/2) ([kevinwilson541](https://github.com/kevinwilson541))
+- Kevin/develop [\#1](https://github.com/azuqua/clusterluck/pull/1) ([kevinwilson541](https://github.com/kevinwilson541))
+
+
+
+\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\ No newline at end of file
diff --git a/README.md b/README.md
index b9510ee..6266f0b 100644
--- a/README.md
+++ b/README.md
@@ -62,7 +62,6 @@ $ npm install --global istanbul
- [`mremove`](#mremove)
- [Consistent Hash Ring](#ConsistentHashRing)
- [Vector Clocks](#VectorClocks)
-- [ChangeLog](#ChangeLog)
- [TODO](#TODO)
### Usage
@@ -456,21 +455,6 @@ Some helpful resources for learning about vector clocks:
From here, you can reference the documentation found on the github pages for the VectorClock class.
-### ChangeLog
-
-- 1.1.3:
- - README fixes for command descriptions.
-- 1.1.2:
- - Remove TODOs from bin/cli.
-- 1.1.1:
- - Grammatical fixes to README.
-- 1.1.0:
- - Add timeouts on GenServer request streams.
- - Emit stream error on closed socket connection.
- - Additional documentation.
-- Dawn of time (unversioned up to 1.0.0):
- - Check the commit history for details (about code changes, dawn of time undocumented).
-
### TODO
In addition to what currently exists in this library, here's a list of features to possibly add:
diff --git a/bin/cli.js b/bin/cli.js
index 1943470..95777ff 100755
--- a/bin/cli.js
+++ b/bin/cli.js
@@ -13,7 +13,7 @@ const path = require("path"),
const vorpal = require("vorpal")();
const argv = require("yargs")
- .usage("Usage: $0 -h localhost -p 7021 -a '' -I foo")
+ .usage("Usage: $0 [OPTIONS] [cmd [arg [arg ...]]]")
.demand([])
.help("help")
.describe("I", "Unique instance identifier of the node being connected to.")
@@ -63,6 +63,11 @@ class Client extends EventEmitter {
this._ipc.of[this._id].on("disconnect", _.partial(this._handleDisconnect).bind(this));
}
+ stop() {
+ this._ipc.disconnect(this._id);
+ return this;
+ }
+
send(comm, message, cb) {
const data = Buffer.from(JSON.stringify({event: comm, data: message}));
const msg = {
@@ -260,8 +265,19 @@ ipc.connectToNet(argv.I, argv.H, argv.p, () => {
client = new Client(ipc, argv.I, argv.H, argv.p, argv.a);
client.start();
client.once("connect", () => {
- vorpal
- .delimiter("> ")
- .show();
+ if (argv._.length === 0) {
+ vorpal
+ .delimiter("> ")
+ .show();
+ } else {
+ vorpal.exec(argv._, function (err, res) {
+ client.stop();
+ if (err) {
+ process.exit(1);
+ } else {
+ process.exit(0);
+ }
+ });
+ }
});
});