-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcli.js
executable file
·60 lines (52 loc) · 1.27 KB
/
cli.js
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
#! /usr/bin/env node
import {program} from 'commander';
import {packageJson} from './constants/index.js';
import {
disable,
enable,
setModeProfile,
status,
updateProfile,
} from './actions/index.js';
program
.name(packageJson.name)
.description(packageJson.description)
.version(packageJson.version);
program
.command('disable')
.description(
'disable automatic macOS Terminal profile switching based on system dark / light mode',
)
.action(disable);
program
.command('enable')
.description(
'enable automatic macOS Terminal profile switching based on system dark / light mode',
)
.option(
'--dark-profile <profile>',
'dark profile name, for example "One Dark"',
)
.option(
'--light-profile <profile>',
'light profile name, for example "One Light"',
)
.action(enable);
for (const mode of ['dark', 'light']) {
program
.command(`set-${mode}-profile`)
.description(`set the Terminal profile to use in ${mode} mode`)
.argument('<profile>')
.action((profile) => setModeProfile({mode, profile}));
}
program
.command('status')
.description('show status and configuration')
.action(status);
program
.command('update-profile')
.description(
'update the profile of currently running Terminal windows / tabs',
)
.action(updateProfile);
program.parse();