Skip to content

Commit

Permalink
endo/cli Nits
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Aug 24, 2020
1 parent 3c8dc53 commit 4cee940
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/endo/src/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function noArchiveUsage() {
async function subcommand([arg, ...rest], handlers) {
const keys = Object.keys(handlers);
if (arg === undefined || !keys.includes(arg)) {
return usage(`expected one of ${keys}`);
return usage(`expected one of ${keys.join(", ")}`);
}
return handlers[arg](rest);
}
Expand Down Expand Up @@ -77,6 +77,9 @@ async function run(args, { cwd, read, write, stdout }) {

export async function main(process, modules) {
const { fs } = modules;
const { cwd, stdout } = process;

// Filesystem errors often don't have stacks:

async function read(location) {
try {
Expand All @@ -98,8 +101,8 @@ export async function main(process, modules) {
process.exitCode = await run(process.argv.slice(2), {
read,
write,
cwd: process.cwd,
stdout: process.stdout
cwd,
stdout
});
} catch (error) {
process.exitCode = usage(error.stack || error.message);
Expand Down

0 comments on commit 4cee940

Please sign in to comment.