Skip to content

Commit

Permalink
CLI unknown command error
Browse files Browse the repository at this point in the history
  • Loading branch information
lafkpages committed Oct 16, 2023
1 parent f1922a4 commit 82824ef
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cli/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
#!/usr/bin/env node

import { help } from "./help";
import { error } from "../log";
import { colors, error } from "../log";

const command = process.argv[2];

if (!command) {
error("No command specified\n");
help(2);
}

const commands = ["extract", "pack", "list", "help"];

if (!commands.includes(command)) {
error(`Unknown command ${colors.bold(`"${command}"`)}\n`);
help(2);
}

0 comments on commit 82824ef

Please sign in to comment.