-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathglow.ts
95 lines (93 loc) · 2.15 KB
/
glow.ts
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
import { filepaths } from "@fig/autocomplete-generators";
const completionSpec: Fig.Spec = {
name: "glow",
description: "Render markdown on the CLI, with pizzazz!",
args: {
name: "source|dir",
isOptional: true,
isVariadic: true,
generators: filepaths({
extensions: ["md"],
editFileSuggestions: { priority: 52 },
editFolderSuggestions: { priority: 51 },
}),
},
options: [
{
name: ["-a", "--all"],
description: "Show system files and directories (TUI-mode only)",
},
{
name: "--config",
args: { name: "path", template: "filepaths" },
description: "Config file",
isPersistent: true,
},
{
name: ["-h", "--help"],
description: "Help for glow",
isPersistent: true,
},
{
name: ["-l", "--local"],
description: "Show local files only; no network (TUI-mode only)",
},
{
name: ["-p", "--pager"],
description: "Display with pager",
},
{
name: ["-s", "--style"],
description: "Style name or JSON path (default 'auto')",
args: {
name: "name",
suggestions: ["auto", "light", "dark", "notty"],
template: "filepaths",
},
},
{
name: ["-v", "--version"],
description: "Version for glow",
},
{
name: ["-w", "--width"],
args: { name: "column" },
description: "Word-wrap at width",
},
],
subcommands: [
{
name: "config",
description: "Edit the glow config file",
},
{
name: "help",
description: "Help about any command",
args: {
name: "command",
template: "help",
isOptional: true,
},
},
{
name: "stash",
description: "Manage your stash of markdown files",
args: {
name: "path",
isOptional: true,
generators: filepaths({
extensions: ["md"],
}),
},
options: [
{
name: ["-m", "--memo"],
description: "Memo/note for stashing",
args: { name: "note" },
insertValue: "--memo '{cursor}'",
},
],
},
],
};
export default completionSpec;