Skip to content

Commit

Permalink
chore(cli): add --debug option
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Mar 12, 2024
1 parent 23026fd commit 9082c31
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const main = new Command()
"Check updates to dependencies in Deno modules and configuration files",
)
.versionOption("-v, --version", "Print version info.", versionCommand)
.option("--debug", "Enable verbose error messages")
.option("--import-map <file:string>", "Specify import map file")
.option("--ignore=<deps:string[]>", "Ignore dependencies")
.option("--only=<deps:string[]>", "Check specified dependencies")
Expand Down Expand Up @@ -323,8 +324,10 @@ try {
}
await main.parse(Deno.args);
} catch (error) {
if (error.message) {
console.error("Error: " + error.message);
if (Deno.args.includes("--debug")) {
throw error;
} else if (error.message) {
console.error(error.message);
}
Deno.exit(1);
}

0 comments on commit 9082c31

Please sign in to comment.