Skip to content

Commit

Permalink
support ssl for monocart cli
Browse files Browse the repository at this point in the history
  • Loading branch information
cenfun committed Jan 13, 2024
1 parent 9268eab commit 7a39171
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ program
program.command('show-report')
.alias('show')
.description('Show report')
.argument('[path]', 'Report dir or html path')
.option('-s, --ssl <key,cert>', 'Start ssl server')
.argument('<path-to-report>', 'Report dir or html path')
.option('-s, --ssl <path-to-key,path-to-cert>', 'Start https server')
.action((str, options) => {
options.open = true;
serveReport(str, options);
Expand All @@ -170,15 +170,16 @@ program.command('show-report')
program.command('serve-report')
.alias('serve')
.description('Serve report')
.argument('[path]', 'Report dir or html path')
.option('-s, --ssl [path]', 'Start ssl server')
.argument('<path-to-report>', 'Report dir or html path')
.option('-s, --ssl <path-to-key,path-to-cert>', 'Start https server')
.action((str, options) => {
serveReport(str, options);
});

program.addHelpText('after', `
Starts ${EC.cyan('https')} with option --ssl:
monocart show-report path-to/index.html ${EC.cyan('--ssl path-to/key,path-to/cert')}
monocart show-report <path-to-report> ${EC.cyan('--ssl <path-to-key,path-to-cert>')}
# Create and install local CA with 'mkcert', see: https://mkcert.dev
`);

program.parse();

0 comments on commit 7a39171

Please sign in to comment.