From 100d3dee18e0e710b7b2afd450e6046a309b3789 Mon Sep 17 00:00:00 2001 From: Mattias Erming Date: Mon, 18 Aug 2014 18:53:17 -0700 Subject: [PATCH] Added 'shout config' command --- README.md | 10 +++++++++- package.json | 2 +- src/cli/config.js | 13 +++++++++++++ src/cli/index.js | 1 + 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 src/cli/config.js diff --git a/README.md b/README.md index 8d71de5..83ca65a 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,7 @@ shout ``` For more information: + ``` shout --help ``` @@ -40,7 +41,13 @@ shout --help ## Configuration -Open your `config.json` file and edit: +Open the `config.json` file by running: + +``` +shout config +``` + +The settings: __port__ The default port to be used. @@ -50,6 +57,7 @@ __public__ Set to either `true|false`. When set to `false`, a login will be required for connecting users. + ## User Management Go ahead and run `shout --help`: diff --git a/package.json b/package.json index abf8ea9..8621d69 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "shout", "description": "A web IRC client", - "version": "0.10.4", + "version": "0.10.5", "author": "Mattias Erming", "preferGlobal": true, "bin": { diff --git a/src/cli/config.js b/src/cli/config.js new file mode 100644 index 0000000..365fbfc --- /dev/null +++ b/src/cli/config.js @@ -0,0 +1,13 @@ +var program = require("commander"); +var child = require("child_process"); + +program + .command("config") + .description("Open the config") + .action(function() { + child.spawn( + "sudo", + ["vim", process.cwd() + "/config.json"], + {stdio: "inherit"} + ); + }); diff --git a/src/cli/index.js b/src/cli/index.js index 325b6aa..4457847 100644 --- a/src/cli/index.js +++ b/src/cli/index.js @@ -1,6 +1,7 @@ var program = require("commander"); require("./start"); +require("./config"); require("./list"); require("./add"); require("./remove");