Skip to content

Commit

Permalink
fix(komandi): add default usage function
Browse files Browse the repository at this point in the history
  • Loading branch information
egasimus committed Jan 5, 2022
1 parent b6bccd2 commit 51b434a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/komandi/komandi.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export default async function runCommands (
commands: Record<string, any>,
words: Array<string>,
usage: (command: any)=>any
usage: (command: any) => any = command => {
console.log('Available commands:')
for (const name of Object.keys(command)) {
console.log(` ${name}`)
}
}
) {

let command = commands
Expand Down

0 comments on commit 51b434a

Please sign in to comment.