Skip to content

Commit

Permalink
add --show option to hft
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Sep 10, 2014
1 parent f0454a6 commit f40442d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
9 changes: 5 additions & 4 deletions server/common-cli-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
"use strict";

exports.options = [
{ option: 'port', alias: 'p', type: 'Int', description: 'port. Default 18679'},
{ option: 'dns', type: 'Boolean', description: 'enable dns server'},
{ option: 'address', type: 'String', description: 'ip address for dns and controller url conversion'},
{ option: 'app-mode', type: 'Boolean', description: 'run as an app'},
{ option: 'port', alias: 'p', type: 'Int', description: 'port. Default 18679'},
{ option: 'dns', type: 'Boolean', description: 'enable dns server'},
{ option: 'address', type: 'String', description: 'ip address for dns and controller url conversion'},
{ option: 'app-mode', type: 'Boolean', description: 'run as an app'},
{ option: 'show', type: 'String', description: 'html file to launch, default "games"'},
];

5 changes: 3 additions & 2 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ var launchBrowser = function(err) {
};

var p;
if (args.appMode) {
p = browser.launch("http://localhost:" + server.getSettings().port + "/games.html", config.getConfig().preferredBrowser);
if (args.appMode || args.show) {
var name = args.show || "games";
p = browser.launch("http://localhost:" + server.getSettings().port + "/" + name + ".html", config.getConfig().preferredBrowser);
} else {
p = Promise.resolve();
}
Expand Down

0 comments on commit f40442d

Please sign in to comment.