mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-25 22:50:42 +03:00
Add a verbose mode
This commit is contained in:
parent
09027a3834
commit
6e36e78637
@ -23,12 +23,13 @@ Give me an Elm file, I'll compile it behind the scenes using Elm 0.19.1, and the
|
||||
.usage('[options] <src/Main.elm>')
|
||||
.option('--output <output>', 'the javascript file to create.', 'elm.js')
|
||||
.option('-O3, --optimize-speed', 'Enable optimizations that likely increases asset size', false)
|
||||
.option('--verbose', 'Show more error details, useful to provide better bug reports', false)
|
||||
// .option('--init-benchmark <dir>', 'Generate some files to help run benchmarks')
|
||||
// .option('--benchmark <dir>', 'Run the benchmark in the given directory.')
|
||||
// .option('--replacements <dir>', 'Replace stuff')
|
||||
.parse(process.argv);
|
||||
|
||||
const { output, optimizeSpeed } = program.opts();
|
||||
const { output, optimizeSpeed, verbose } = program.opts();
|
||||
run(
|
||||
{
|
||||
inputFilePath: program.args[0],
|
||||
@ -37,6 +38,10 @@ run(
|
||||
},
|
||||
console.log.bind(console),
|
||||
).catch((e) => {
|
||||
if (verbose) {
|
||||
console.error(e);
|
||||
} else {
|
||||
console.error(e.toString());
|
||||
}
|
||||
process.exit(1);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user