Skip to content

Commit

Permalink
add optional path argument for specific browser
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott authored and indexzero committed Mar 19, 2015
1 parent 991c68a commit ca4aee6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions bin/http-server
Expand Up @@ -20,7 +20,7 @@ if (argv.h || argv.help) {
" -e --ext Default file extension if none supplied [none]",
" -s --silent Suppress log messages from output",
" --cors Enable CORS via the 'Access-Control-Allow-Origin' header",
" -o Open browser window after staring the server",
" -o [path] Open browser window after starting the server",
" -c Cache time (max-age) in seconds [3600], e.g. -c10 for 10 seconds.",
" To disable caching, use -c-1.",
"",
Expand Down Expand Up @@ -102,7 +102,10 @@ function listen(port) {

log('Hit CTRL-C to stop the server');
if (argv.o) {
opener(protocol + '//' + canonicalHost + ':' + port);
opener(
protocol + '//' + canonicalHost + ':' + port,
{ command: argv.o !== true ? argv.o : null }
);
}
});
}
Expand Down

0 comments on commit ca4aee6

Please sign in to comment.