From f8e94636f80e53f4a91aec1827134f78674787b0 Mon Sep 17 00:00:00 2001 From: Sean Sube Date: Sun, 1 Jan 2023 11:38:53 -0600 Subject: [PATCH] add list command to list of commands --- src/args.ts | 3 +++ src/command/index.ts | 2 +- src/main.ts | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) 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,