Skip to content

Commit 6fc570e

Browse files
committed
feat: add list command
1 parent 7977588 commit 6fc570e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/commands/cmd/alias/list.ts

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { Command } from '@oclif/core';
2+
import { EOL } from 'node:os';
3+
import { readAliasFile } from '../../../utils';
4+
5+
export class CmdAliasList extends Command {
6+
async run(): Promise<void> {
7+
const aliases = await readAliasFile(this.config);
8+
9+
let output = '';
10+
for (const key of Object.keys(aliases)) {
11+
output += `${key}: ${aliases[key]}${EOL}`;
12+
}
13+
14+
this.log(output.slice(0, -1));
15+
}
16+
}

0 commit comments

Comments
 (0)