add list command to list of commands
This commit is contained in:
parent
40714f83c7
commit
f8e94636f8
|
@ -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';
|
||||
})
|
||||
|
|
|
@ -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';
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue