Skip to content

Commit d0152e7

Browse files
committed
chore: doc search
1 parent 241e294 commit d0152e7

File tree

8 files changed

+430
-249
lines changed

8 files changed

+430
-249
lines changed

Cargo.lock

Lines changed: 338 additions & 163 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ path = "src/main.rs"
2020
[dependencies]
2121
chrono = "0.4"
2222
clap = { version = "4", features = ["derive"] }
23-
clap_usage = "1"
23+
clap_usage = "2"
2424
comfy-table = "7.1.3"
2525
console = "0.15"
2626
dirs = "5"

docs/.vitepress/config.mts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,7 @@ export default defineConfig({
4444
logo: "/logo.png",
4545
},
4646
head: [["link", { rel: "icon", href: "/img/favicon.ico" }]],
47+
search: {
48+
provider: "local",
49+
}
4750
});

docs/cli/commands.json

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"help": "The shell to generate source for",
1919
"help_first_line": "The shell to generate source for",
2020
"required": true,
21+
"double_dash": "Optional",
2122
"hide": false
2223
}
2324
],
@@ -53,6 +54,7 @@
5354
"name": "SHELL_PID",
5455
"usage": "<SHELL_PID>",
5556
"required": true,
57+
"double_dash": "Optional",
5658
"hide": false
5759
}
5860
}
@@ -102,6 +104,7 @@
102104
"help": "ID of the daemon to add",
103105
"help_first_line": "ID of the daemon to add",
104106
"required": true,
107+
"double_dash": "Optional",
105108
"hide": false
106109
},
107110
{
@@ -110,6 +113,7 @@
110113
"help": "Arguments to pass to the daemon",
111114
"help_first_line": "Arguments to pass to the daemon",
112115
"required": false,
116+
"double_dash": "Automatic",
113117
"var": true,
114118
"hide": false
115119
}
@@ -164,6 +168,7 @@
164168
"help": "The ID of the daemon to remove",
165169
"help_first_line": "The ID of the daemon to remove",
166170
"required": true,
171+
"double_dash": "Optional",
167172
"hide": false
168173
}
169174
],
@@ -205,6 +210,7 @@
205210
"help": "The shell to generate completion for",
206211
"help_first_line": "The shell to generate completion for",
207212
"required": true,
213+
"double_dash": "Optional",
208214
"hide": false
209215
}
210216
],
@@ -230,6 +236,7 @@
230236
"help": "Name of the daemon to disable",
231237
"help_first_line": "Name of the daemon to disable",
232238
"required": true,
239+
"double_dash": "Optional",
233240
"hide": false
234241
}
235242
],
@@ -257,6 +264,7 @@
257264
"help": "Name of the daemon to enable",
258265
"help_first_line": "Name of the daemon to enable",
259266
"required": true,
267+
"double_dash": "Optional",
260268
"hide": false
261269
}
262270
],
@@ -315,6 +323,7 @@
315323
"help": "Show only logs for the specified daemon(s)",
316324
"help_first_line": "Show only logs for the specified daemon(s)",
317325
"required": false,
326+
"double_dash": "Optional",
318327
"var": true,
319328
"hide": false
320329
}
@@ -350,6 +359,7 @@
350359
"name": "N",
351360
"usage": "<N>",
352361
"required": true,
362+
"double_dash": "Optional",
353363
"hide": false
354364
}
355365
},
@@ -382,7 +392,7 @@
382392
"full_cmd": [
383393
"run"
384394
],
385-
"usage": "run [-f --force] <ID> [RUN]...",
395+
"usage": "run [-f --force] <ID> [-- RUN]...",
386396
"subcommands": {},
387397
"args": [
388398
{
@@ -391,12 +401,14 @@
391401
"help": "Name of the daemon to run",
392402
"help_first_line": "Name of the daemon to run",
393403
"required": true,
404+
"double_dash": "Optional",
394405
"hide": false
395406
},
396407
{
397408
"name": "RUN",
398-
"usage": "[RUN]...",
409+
"usage": "[-- RUN]...",
399410
"required": false,
411+
"double_dash": "Required",
400412
"var": true,
401413
"hide": false
402414
}
@@ -438,6 +450,7 @@
438450
"help": "ID of the daemon(s) in pitchfork.toml to start",
439451
"help_first_line": "ID of the daemon(s) in pitchfork.toml to start",
440452
"required": false,
453+
"double_dash": "Optional",
441454
"var": true,
442455
"hide": false
443456
}
@@ -470,6 +483,7 @@
470483
"name": "SHELL_PID",
471484
"usage": "<SHELL_PID>",
472485
"required": true,
486+
"double_dash": "Optional",
473487
"hide": false
474488
}
475489
},
@@ -509,6 +523,7 @@
509523
"name": "ID",
510524
"usage": "<ID>",
511525
"required": true,
526+
"double_dash": "Optional",
512527
"hide": false
513528
}
514529
],
@@ -536,6 +551,7 @@
536551
"help": "The name of the daemon to stop",
537552
"help_first_line": "The name of the daemon to stop",
538553
"required": false,
554+
"double_dash": "Optional",
539555
"var": true,
540556
"hide": false
541557
}
@@ -699,6 +715,7 @@
699715
"help": "The name of the daemon to wait for",
700716
"help_first_line": "The name of the daemon to wait for",
701717
"required": true,
718+
"double_dash": "Optional",
702719
"hide": false
703720
}
704721
],

docs/cli/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- [`pitchfork enable <ID>`](/cli/enable.md)
1919
- [`pitchfork list [--hide-header]`](/cli/list.md)
2020
- [`pitchfork logs [FLAGS] [ID]...`](/cli/logs.md)
21-
- [`pitchfork run [-f --force] <ID> [RUN]...`](/cli/run.md)
21+
- [`pitchfork run [-f --force] <ID> [-- RUN]...`](/cli/run.md)
2222
- [`pitchfork start [-a --all] [-f --force] [ID]...`](/cli/start.md)
2323
- [`pitchfork status <ID>`](/cli/status.md)
2424
- [`pitchfork stop [ID]...`](/cli/stop.md)

docs/cli/run.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `pitchfork run`
22

3-
- **Usage**: `pitchfork run [-f --force] <ID> [RUN]...`
3+
- **Usage**: `pitchfork run [-f --force] <ID> [-- RUN]...`
44
- **Aliases**: `r`
55

66
Runs a one-off daemon
@@ -11,12 +11,8 @@ Runs a one-off daemon
1111

1212
Name of the daemon to run
1313

14-
### `[RUN]...`
15-
16-
Runs a one-off daemon
14+
### `[-- RUN]...`
1715

1816
## Flags
1917

2018
### `-f --force`
21-
22-
Runs a one-off daemon

docs/cli/status.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,3 @@ Display the status of a daemon
88
## Arguments
99

1010
### `<ID>`
11-
12-
Display the status of a daemon

pitchfork.usage.kdl

Lines changed: 66 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,101 @@
1-
name "pitchfork"
2-
bin "pitchfork"
1+
name pitchfork
2+
bin pitchfork
33
version "0.1.5"
44
about "Daemons with DX"
55
usage "Usage: pitchfork <COMMAND>"
6-
cmd "activate" help="Activate pitchfork in your shell session" {
7-
long_help r"Activate pitchfork in your shell session
8-
9-
Necessary for autostart/stop when entering/exiting projects with pitchfork.toml files"
10-
arg "<SHELL>" help="The shell to generate source for"
6+
cmd activate help="Activate pitchfork in your shell session" {
7+
long_help "Activate pitchfork in your shell session\n\nNecessary for autostart/stop when entering/exiting projects with pitchfork.toml files"
8+
arg <SHELL> help="The shell to generate source for"
119
}
12-
cmd "cd" hide=true {
13-
flag "--shell-pid" required=true {
14-
arg "<SHELL_PID>"
10+
cmd cd hide=#true {
11+
flag --shell-pid required=#true {
12+
arg <SHELL_PID>
1513
}
1614
}
17-
cmd "clean" help="Removes stopped/failed daemons from `pitchfork list`" {
18-
alias "c"
19-
}
20-
cmd "config" help="manage/edit pitchfork.toml files" {
21-
alias "cfg"
22-
long_help r"manage/edit pitchfork.toml files
23-
24-
without a subcommand, lists all pitchfork.toml files from the current directory"
25-
cmd "add" help="Add a new daemon to ./pitchfork.toml" {
26-
alias "a"
27-
flag "--autostart" help="Autostart the daemon when entering the directory"
28-
flag "--autostop" help="Autostop the daemon when leaving the directory"
29-
arg "<ID>" help="ID of the daemon to add"
30-
arg "[ARGS]..." help="Arguments to pass to the daemon" var=true
15+
cmd clean help="Removes stopped/failed daemons from `pitchfork list`" {
16+
alias c
17+
}
18+
cmd config help="manage/edit pitchfork.toml files" {
19+
alias cfg
20+
long_help "manage/edit pitchfork.toml files\n\nwithout a subcommand, lists all pitchfork.toml files from the current directory"
21+
cmd add help="Add a new daemon to ./pitchfork.toml" {
22+
alias a
23+
flag --autostart help="Autostart the daemon when entering the directory"
24+
flag --autostop help="Autostop the daemon when leaving the directory"
25+
arg <ID> help="ID of the daemon to add"
26+
arg "[ARGS]..." help="Arguments to pass to the daemon" required=#false double_dash=automatic var=#true
3127
}
32-
cmd "remove" help="Remove a daemon from pitchfork.toml" {
33-
alias "rm"
34-
arg "<ID>" help="The ID of the daemon to remove"
28+
cmd remove help="Remove a daemon from pitchfork.toml" {
29+
alias rm
30+
arg <ID> help="The ID of the daemon to remove"
3531
}
3632
}
37-
cmd "completion" help="Generates shell completion scripts" {
38-
arg "<SHELL>" help="The shell to generate completion for"
33+
cmd completion help="Generates shell completion scripts" {
34+
arg <SHELL> help="The shell to generate completion for"
3935
}
40-
cmd "disable" help="Prevent a daemon from restarting" {
41-
alias "d"
42-
arg "<ID>" help="Name of the daemon to disable"
36+
cmd disable help="Prevent a daemon from restarting" {
37+
alias d
38+
arg <ID> help="Name of the daemon to disable"
4339
}
44-
cmd "enable" help="Allow a daemon to start" {
45-
alias "e"
46-
arg "<ID>" help="Name of the daemon to enable"
40+
cmd enable help="Allow a daemon to start" {
41+
alias e
42+
arg <ID> help="Name of the daemon to enable"
4743
}
48-
cmd "list" help="List all daemons" {
49-
alias "ls"
50-
flag "--hide-header" help="Show header"
44+
cmd list help="List all daemons" {
45+
alias ls
46+
flag --hide-header help="Show header"
5147
}
52-
cmd "logs" help="Displays logs for daemon(s)" {
53-
alias "l"
48+
cmd logs help="Displays logs for daemon(s)" {
49+
alias l
5450
flag "-c --clear" help="Delete logs"
55-
flag "-n" help="Show N lines of logs" {
51+
flag -n help="Show N lines of logs" {
5652
long_help "Show N lines of logs\n\nSet to 0 to show all logs"
57-
arg "<N>"
53+
arg <N>
5854
}
5955
flag "-t --tail" help="Show logs in real-time"
60-
arg "[ID]..." help="Show only logs for the specified daemon(s)" var=true
56+
arg "[ID]..." help="Show only logs for the specified daemon(s)" required=#false var=#true
6157
}
62-
cmd "run" help="Runs a one-off daemon" {
63-
alias "r"
58+
cmd run help="Runs a one-off daemon" {
59+
alias r
6460
flag "-f --force"
65-
arg "<ID>" help="Name of the daemon to run"
66-
arg "[RUN]..." var=true
61+
arg <ID> help="Name of the daemon to run"
62+
arg "[-- RUN]..." required=#false var=#true
6763
}
68-
cmd "start" help="Starts a daemon from a pitchfork.toml file" {
69-
alias "s"
64+
cmd start help="Starts a daemon from a pitchfork.toml file" {
65+
alias s
7066
flag "-a --all" help="Start all daemons in all pitchfork.tomls"
71-
flag "--shell-pid" hide=true {
72-
arg "<SHELL_PID>"
67+
flag --shell-pid hide=#true {
68+
arg <SHELL_PID>
7369
}
7470
flag "-f --force" help="Stop the daemon if it is already running"
75-
arg "[ID]..." help="ID of the daemon(s) in pitchfork.toml to start" var=true
71+
arg "[ID]..." help="ID of the daemon(s) in pitchfork.toml to start" required=#false var=#true
7672
}
77-
cmd "status" help="Display the status of a daemon" {
78-
alias "stat"
79-
arg "<ID>"
73+
cmd status help="Display the status of a daemon" {
74+
alias stat
75+
arg <ID>
8076
}
81-
cmd "stop" help="Sends a stop signal to a daemon" {
82-
alias "kill"
83-
arg "[ID]..." help="The name of the daemon to stop" var=true
77+
cmd stop help="Sends a stop signal to a daemon" {
78+
alias kill
79+
arg "[ID]..." help="The name of the daemon to stop" required=#false var=#true
8480
}
85-
cmd "supervisor" subcommand_required=true help="Start, stop, and check the status of the pitchfork supervisor daemon" {
86-
alias "sup"
87-
cmd "run" help="Runs the internal pitchfork daemon in the foreground" {
81+
cmd supervisor subcommand_required=#true help="Start, stop, and check the status of the pitchfork supervisor daemon" {
82+
alias sup
83+
cmd run help="Runs the internal pitchfork daemon in the foreground" {
8884
flag "-f --force" help="kill existing daemon"
8985
}
90-
cmd "start" help="Starts the internal pitchfork daemon in the background" {
86+
cmd start help="Starts the internal pitchfork daemon in the background" {
9187
flag "-f --force" help="kill existing daemon"
9288
}
93-
cmd "status" help="Gets the status of the pitchfork daemon"
94-
cmd "stop" help="Stops the internal pitchfork daemon running in the background"
89+
cmd status help="Gets the status of the pitchfork daemon"
90+
cmd stop help="Stops the internal pitchfork daemon running in the background"
9591
}
96-
cmd "usage" hide=true help="Generates a usage spec for the CLI" {
97-
long_help r"Generates a usage spec for the CLI
98-
99-
https://usage.jdx.dev"
92+
cmd usage hide=#true help="Generates a usage spec for the CLI" {
93+
long_help "Generates a usage spec for the CLI\n\nhttps://usage.jdx.dev"
10094
}
101-
cmd "wait" help="Wait for a daemon to stop, tailing the logs along the way" {
102-
alias "w"
103-
long_help r"Wait for a daemon to stop, tailing the logs along the way
104-
105-
Exits with the same status code as the daemon"
106-
arg "<ID>" help="The name of the daemon to wait for"
95+
cmd wait help="Wait for a daemon to stop, tailing the logs along the way" {
96+
alias w
97+
long_help "Wait for a daemon to stop, tailing the logs along the way\n\nExits with the same status code as the daemon"
98+
arg <ID> help="The name of the daemon to wait for"
10799
}
108100

109101
complete "id" run="pitchfork ls | awk '{print $1}'"

0 commit comments

Comments
 (0)