1
0
Fork 0

add list command to list of commands

This commit is contained in:
Sean Sube 2023-01-01 11:38:53 -06:00
parent 40714f83c7
commit f8e94636f8
3 changed files with 5 additions and 1 deletions

View File

@ -62,6 +62,9 @@ export async function parseArgs(argv: Array<string>): Promise<ParsedArgs> {
const parser = yargs(argv)
.usage(`Usage: ${APP_NAME} <command> [options]`)
.command('check', 'check if a lock exists')
.command('list', 'list all locks', () => { /* noop */}, () => {
command = 'list';
})
.command('lock', 'lock a path', () => { /* noop */}, () => {
command = 'lock';
})

View File

@ -11,4 +11,4 @@ export interface CommandContext {
export type CommandFunction = (context: CommandContext) => Promise<boolean>;
export type CommandName = 'check' | 'lock' | 'unlock' | 'prune';
export type CommandName = 'check' | 'list' | 'lock' | 'unlock' | 'prune';

View File

@ -20,6 +20,7 @@ export enum ExitCode {
export const Commands: Record<CommandName, CommandFunction> = {
check: checkCommand,
list: checkCommand, // TODO: implement list
lock: lockCommand,
unlock: unlockCommand,
prune: pruneCommand,