-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprogram.ts
More file actions
62 lines (51 loc) · 1.42 KB
/
program.ts
File metadata and controls
62 lines (51 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import { program } from 'commander';
import { add, diff, rename, reset, stash, worktreeAdd, worktreeOpen, worktreeDelete } from './wiz';
import { version } from '../../package.json';
export function init() {
try {
program.version(version);
program
.command('add')
.description('do "git add" with style 📥')
.action(add);
program
.command('reset')
.description('do "git reset" with style 🔙')
.action(reset);
program
.command('stash')
.description('do "git stash" with style 👜')
.action(stash);
program
.command('diff')
.allowUnknownOption()
.description(
'do "git diff" with style 🤔 (Accept any argument "git diff" accpets)'
)
.action(diff);
program
.command('rename')
.description(
'do "git mv" (for renaming) with style 🔖'
)
.action(rename);
const worktree = program
.command('worktree')
.description('manage git worktrees 🌲');
worktree
.command('add')
.description('add a new worktree 🌱')
.action(worktreeAdd);
worktree
.command('open')
.description('open a worktree in your editor 📂')
.action(worktreeOpen);
worktree
.command('delete')
.description('delete a worktree 🗑️')
.action(worktreeDelete);
program.parse(process.argv);
} catch (error) {
console.log(error);
}
}