-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.ts
More file actions
53 lines (50 loc) · 1.36 KB
/
cli.ts
File metadata and controls
53 lines (50 loc) · 1.36 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
#!/usr/bin/env node
import yargs from 'yargs'
import { hideBin } from 'yargs/helpers'
import { showDiff, DiffOptions } from './diff'
const argv = yargs(hideBin(process.argv))
.option('includePlusMinus', {
alias: 'p',
type: 'boolean',
description: 'Include plus/minus signs in the diff output',
default: true,
})
.option('includeColors', {
alias: 'c',
type: 'boolean',
description: 'Include colors in the diff output',
default: true,
})
.option('includeEmoji', {
alias: 'e',
type: 'boolean',
description: 'Include emojis next to file names to visually group them.',
default: true,
})
.option('includeFooter', {
alias: 'f',
type: 'boolean',
description: 'Include a line as a footer to close out the diff output',
default: true,
})
.option('useLess', {
alias: 'l',
type: 'boolean',
description: 'Use less as the pager to view output',
default: true,
})
.option('includeUntracked', {
alias: 'u',
type: 'boolean',
description: 'Include untracked files in the diff output (not used when --cached is on)',
default: true,
})
.option('cached', {
alias: 'g',
type: 'boolean',
description: 'Show staged changes (--cached)',
default: false,
})
.help()
.alias('help', 'h').argv as unknown as DiffOptions & { useLess: boolean }
showDiff(argv, argv.useLess)