Skip to content

Commit b9ae2bd

Browse files
committed
docs: clarify utility help syntax
1 parent 7954d02 commit b9ae2bd

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

src/cortex-cli/src/cli/styles.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ pub const HELP_TEMPLATE: &str = color_print::cstr!(
119119
<green,bold>scrape</> Scrape web content to markdown/text/html
120120
<green,bold>stats</> Show usage statistics
121121
<green,bold>completion</> Generate shell completion scripts
122+
<dim>Note: Commands without subcommands only support --help; nested commands like github also accept help.</>
122123
123124
<cyan,bold>🔧 Maintenance:</>
124125
<green,bold>upgrade</> Check for and install updates
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
use clap::CommandFactory;
2+
use cortex_cli::cli::Cli;
3+
4+
#[test]
5+
fn root_help_documents_utility_help_syntax_split() {
6+
let help = Cli::command().render_long_help().to_string();
7+
8+
assert!(
9+
help.contains("Commands without subcommands only support --help"),
10+
"root help should explain why `cortex github help` works while single-purpose utilities use `--help`:\n{help}"
11+
);
12+
}

0 commit comments

Comments
 (0)