Skip to content

Commit

Permalink
Merge 0c92e23 into 2774d43
Browse files Browse the repository at this point in the history
  • Loading branch information
lebedov committed Jan 4, 2021
2 parents 2774d43 + 0c92e23 commit 248622f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
7 changes: 6 additions & 1 deletion lib/cli-defs.js
Expand Up @@ -6,7 +6,7 @@ module.exports = {
},

livereloadport: {
alias: 'b',
alias: 'l',
default: 35729
},

Expand All @@ -23,6 +23,11 @@ module.exports = {
verbose: {
alias: 'v',
default: false
},

browser: {
alias: 'b',
default: true
}
}
}
12 changes: 6 additions & 6 deletions lib/cli-help.txt
Expand Up @@ -3,9 +3,9 @@ $ markserv <file/dir>
$ readme (serve closest README.md file)

Options
--port, -p, HTTP port [port] (80)
--livereloadport, -l LiveReload port [port/false] (35729)
--browser, -b Launch browser (true)
--silent, -i Silent (false)
--address, -a Serve on ip/address [address] (localhost)
--verbose, -v Verbose output (false)
--port, -p, HTTP port [port] (80)
--livereloadport, -l LiveReload port [port/false] (35729)
--browser, -b Launch browser [browser/true/false] (true)
--silent, -i Silent (false)
--address, -a Serve on ip/address [address] (localhost)
--verbose, -v Verbose output (false)
8 changes: 7 additions & 1 deletion lib/server.js
Expand Up @@ -702,8 +702,14 @@ const init = async flags => {
return
}

// Manually set browser if so specified
let opts = {}
if (typeof flags.browser === 'string') {
opts = {app: flags.browser}
}

if (launchUrl) {
opn(launchUrl)
opn(launchUrl, opts)
}
}

Expand Down

0 comments on commit 248622f

Please sign in to comment.