-
Notifications
You must be signed in to change notification settings - Fork 8
/
tinty.elvish
203 lines (201 loc) · 9.33 KB
/
tinty.elvish
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
use builtin;
use str;
set edit:completion:arg-completer[tinty] = {|@words|
fn spaces {|n|
builtin:repeat $n ' ' | str:join ''
}
fn cand {|text desc|
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
}
var command = 'tinty'
for word $words[1..-1] {
if (str:has-prefix $word '-') {
break
}
set command = $command';'$word
}
var completions = [
&'tinty'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
cand build 'Builds the target theme template'
cand current 'Prints the last scheme name applied or specific values from the current scheme'
cand generate-completion 'Generates a shell completion script'
cand generate-scheme 'Generates a scheme based on an image'
cand info 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha)'
cand init 'Initializes with the exising config. Used to Initialize exising theme for when your shell starts up'
cand list 'Lists available schemes'
cand config 'Provides config related information'
cand apply 'Applies a theme based on the chosen scheme'
cand install 'Install the environment needed for tinty'
cand update 'Update to the latest themes'
cand sync 'Install missing templates in tinty/config.toml and update existing templates'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'tinty;build'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -q 'Silence stdout'
cand --quiet 'Silence stdout'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;current'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;generate-completion'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;generate-scheme'= {
cand --author 'Scheme author info (name, email, etc) to write, defaults to ''Tinty'''
cand --name 'Scheme display name (can include spaces and capitalization). Defaults to ''Tinty Generated'''
cand --slug 'Scheme slug (the name you specify when applying schemes). Can not contain white-space or capitalization. Defaults to ''tinty-generated'''
cand --system 'Whether to generate a base16 or base24 scheme'
cand --variant 'Whether to generate a dark or light scheme'
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand --save 'Whether to add the scheme to the installed schemes.'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;info'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand --custom-schemes 'Lists availabile custom schemes'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;init'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand --verbose 'Print to stdout'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;list'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand --custom-schemes 'Lists availabile custom schemes'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;config'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand --config-path 'Returns path to the tinty config file'
cand --data-dir-path 'Returns path to the tinty data directory'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;apply'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -q 'Silence stdout'
cand --quiet 'Silence stdout'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;install'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -q 'Silence stdout'
cand --quiet 'Silence stdout'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;update'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -q 'Silence stdout'
cand --quiet 'Silence stdout'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;sync'= {
cand -c 'Optional path to the tinty config.toml file'
cand --config 'Optional path to the tinty config.toml file'
cand -d 'Optional path to the tinty data directory'
cand --data-dir 'Optional path to the tinty data directory'
cand -q 'Silence stdout'
cand --quiet 'Silence stdout'
cand -h 'Print help'
cand --help 'Print help'
}
&'tinty;help'= {
cand build 'Builds the target theme template'
cand current 'Prints the last scheme name applied or specific values from the current scheme'
cand generate-completion 'Generates a shell completion script'
cand generate-scheme 'Generates a scheme based on an image'
cand info 'Shows scheme colors for all schemes matching <scheme_system>-<scheme_name> (Eg: tinty info base16-mocha)'
cand init 'Initializes with the exising config. Used to Initialize exising theme for when your shell starts up'
cand list 'Lists available schemes'
cand config 'Provides config related information'
cand apply 'Applies a theme based on the chosen scheme'
cand install 'Install the environment needed for tinty'
cand update 'Update to the latest themes'
cand sync 'Install missing templates in tinty/config.toml and update existing templates'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'tinty;help;build'= {
}
&'tinty;help;current'= {
}
&'tinty;help;generate-completion'= {
}
&'tinty;help;generate-scheme'= {
}
&'tinty;help;info'= {
}
&'tinty;help;init'= {
}
&'tinty;help;list'= {
}
&'tinty;help;config'= {
}
&'tinty;help;apply'= {
}
&'tinty;help;install'= {
}
&'tinty;help;update'= {
}
&'tinty;help;sync'= {
}
&'tinty;help;help'= {
}
]
$completions[$command]
}