diff --git a/src/args.ts b/src/args.ts index e02afcf..db9c036 100644 --- a/src/args.ts +++ b/src/args.ts @@ -62,6 +62,9 @@ export async function parseArgs(argv: Array): Promise { const parser = yargs(argv) .usage(`Usage: ${APP_NAME} [options]`) .command('check', 'check if a lock exists') + .command('list', 'list all locks', () => { /* noop */}, () => { + command = 'list'; + }) .command('lock', 'lock a path', () => { /* noop */}, () => { command = 'lock'; }) diff --git a/src/command/index.ts b/src/command/index.ts index af88439..8bfbf4d 100644 --- a/src/command/index.ts +++ b/src/command/index.ts @@ -11,4 +11,4 @@ export interface CommandContext { export type CommandFunction = (context: CommandContext) => Promise; -export type CommandName = 'check' | 'lock' | 'unlock' | 'prune'; +export type CommandName = 'check' | 'list' | 'lock' | 'unlock' | 'prune'; diff --git a/src/main.ts b/src/main.ts index 1f2d8c8..be83e85 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,6 +20,7 @@ export enum ExitCode { export const Commands: Record = { check: checkCommand, + list: checkCommand, // TODO: implement list lock: lockCommand, unlock: unlockCommand, prune: pruneCommand,