Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions tools/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Usage: cargo ci [OPTIONS] [COMMAND]

**Options:**

- `--skip`: Skip specified subcommands when running all
- `--skip <SKIP>`: Skip specified subcommands when running all

When no subcommand is specified, all subcommands are run in sequence. This option allows specifying subcommands to skip when running all. For example, to skip the `unreal-tests` subcommand, use `--skip unreal-tests`.

Expand Down Expand Up @@ -98,12 +98,12 @@ Usage: smoketests [OPTIONS] [ARGS]... [COMMAND]

**Options:**

- `--server`: Run tests against a remote server instead of spawning local servers.
- `--server <SERVER>`: Run tests against a remote server instead of spawning local servers.

When specified, tests will connect to the given URL instead of starting local server instances. Tests that require local server control (like restart tests) will be skipped.

- `--dotnet`:
- `args`: Additional arguments to pass to the test runner
- `--dotnet <DOTNET>`:
- `args <ARGS>`: Additional arguments to pass to the test runner
- `--help`: Print help (see a summary with '-h')

#### `prepare`
Expand Down Expand Up @@ -141,7 +141,7 @@ Usage: help [COMMAND]...

**Options:**

- `subcommand`: Print help for the subcommand(s)
- `subcommand <COMMAND>`: Print help for the subcommand(s)

### `keynote-bench`

Expand Down Expand Up @@ -171,7 +171,7 @@ Usage: update-flow [OPTIONS]

**Options:**

- `--target`: Target triple to build for, by default the current target. Used by github workflows to check the update flow on multiple platforms.
- `--target <TARGET>`: Target triple to build for, by default the current target. Used by github workflows to check the update flow on multiple platforms.
- `--github-token-auth`: Whether to enable github token authentication feature when building the update binary. By default this is disabled.
- `--help`: Print help (see a summary with '-h')

Expand All @@ -184,7 +184,7 @@ Usage: cli-docs [OPTIONS]

**Options:**

- `--spacetime-path`: specify a custom path to the SpacetimeDB repository root (where the main Cargo.toml is located)
- `--spacetime-path <SPACETIME_PATH>`: specify a custom path to the SpacetimeDB repository root (where the main Cargo.toml is located)
- `--help`: Print help (see a summary with '-h')

### `self-docs`
Expand Down Expand Up @@ -263,7 +263,7 @@ Usage: help [COMMAND]...

**Options:**

- `subcommand`: Print help for the subcommand(s)
- `subcommand <COMMAND>`: Print help for the subcommand(s)


---
Expand Down
23 changes: 16 additions & 7 deletions tools/ci/src/ci_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,16 @@ fn generate_markdown(cmd: &mut Command, heading_level: usize) -> String {

let mut options = String::new();
for arg in cmd.get_arguments() {
let names = arg
let mut names = arg
.get_long()
.map(|l| format!("--{}", l))
.or_else(|| arg.get_short().map(|s| format!("-{}", s)))
.unwrap_or_else(|| arg.get_id().to_string());
if let Some(value_names) = arg.get_value_names().filter(|_| arg.get_action().takes_values()) {
for value_name in value_names {
names.push_str(&format!(" <{value_name}>"));
}
}
let help = arg
.get_long_help()
.or_else(|| arg.get_help())
Expand All @@ -54,12 +59,16 @@ fn generate_markdown(cmd: &mut Command, heading_level: usize) -> String {
eprintln!("Warning: argument `{}` is missing help text", arg.get_id());
"".to_string()
});
options.push_str(&format!(
"- `{}`: {}\n{}",
names,
help,
if help.lines().count() > 1 { "\n" } else { "" }
));
if help.is_empty() {
options.push_str(&format!("- `{names}`:\n"));
} else {
options.push_str(&format!(
"- `{}`: {}\n{}",
names,
help,
if help.lines().count() > 1 { "\n" } else { "" }
));
}
}

if !options.is_empty() {
Expand Down
Loading