Skip to content

Commit

Permalink
Renamed --no-clipboard to --clipless
Browse files Browse the repository at this point in the history
This makes the options usable with the latest minimist
  • Loading branch information
leo committed Jun 24, 2017
1 parent c923d52 commit a75425f
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions bin/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ const serverHandler = require('../lib/server')
// Throw an error if node version is too low
if (nodeVersion.major < 6) {
console.error(
`${red('Error!')} Serve requires at least version 6 of Node. Please upgrade!`
`${red(
'Error!'
)} Serve requires at least version 6 of Node. Please upgrade!`
)
process.exit(1)
}
Expand Down Expand Up @@ -49,8 +51,9 @@ args
false
)
.option('silent', `Don't log anything to the console`)
.option('no-clipboard', `Don't copy address to clipboard`, false)
.option(['n', 'clipless'], `Don't copy address to clipboard`, false)
.option('open', 'Open local address in browser', false)

const flags = args.parse(process.argv, {
minimist: {
alias: {
Expand All @@ -59,10 +62,18 @@ const flags = args.parse(process.argv, {
S: 'silent',
s: 'single',
u: 'unzipped',
n: 'no-clipboard',
n: 'clipless',
o: 'open'
},
boolean: ['auth', 'cors', 'silent', 'single', 'unzipped', 'no-clipboard', 'open']
boolean: [
'auth',
'cors',
'silent',
'single',
'unzipped',
'clipless',
'open'
]
}
})

Expand Down Expand Up @@ -109,7 +120,13 @@ detect(port).then(open => {
server.listen(
port,
coroutine(function*() {
yield listening(server, current, inUse, flags.noClipboard !== true, flags.open)
yield listening(
server,
current,
inUse,
flags.noClipboard !== true,
flags.open
)
})
)
})

0 comments on commit a75425f

Please sign in to comment.