Skip to content

Commit 9d0fbcf

Browse files
Timna BrownTimna Brown
authored andcommitted
feat: improve --help with table layout and subcommand descriptions
1 parent 478ba20 commit 9d0fbcf

4 files changed

Lines changed: 35 additions & 2 deletions

File tree

src/cli/catalog.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub struct CatalogCommand {
1313

1414
#[derive(Debug, Subcommand)]
1515
pub enum CatalogAction {
16+
/// Export a catalog.json of all repositories (compatible with org-catalog GitHub Pages)
1617
Generate(GenerateCatalogCommand),
1718
}
1819

src/cli/mod.rs

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,30 @@ use clap::{Parser, Subcommand};
1212
#[command(
1313
name = "devopster",
1414
version,
15-
about = "Cross-platform GitOps CLI for managing organization repositories",
16-
long_about = "Manage GitHub, Azure DevOps, and GitLab organizations with a single containerized Rust CLI."
15+
about = "GitOps CLI for GitHub, Azure DevOps, and GitLab",
16+
long_about = None,
17+
help_template = "\
18+
{before-help}devopster {version}
19+
{about}
20+
21+
Usage: devopster [OPTIONS] <COMMAND>
22+
23+
Commands:
24+
{tab}+-------------------+---------------------------------------------------+
25+
{tab}| login | Authenticate with a provider via browser sign-in |
26+
{tab}| init | Create devopster-config.yaml and sign in |
27+
{tab}| repo list | List repositories (optionally filter by topic) |
28+
{tab}| repo audit | Audit repos against the configured policy |
29+
{tab}| repo scaffold | Create a new repository from a template |
30+
{tab}| repo sync | Push files from .github/ to all repositories |
31+
{tab}| catalog generate | Export a catalog.json of all repositories |
32+
{tab}| topics align | Add missing template topics to repositories |
33+
{tab}| stats | Print org-wide metadata coverage and compliance |
34+
{tab}+-------------------+---------------------------------------------------+
35+
36+
Options:
37+
{options}
38+
{after-help}"
1739
)]
1840
pub struct Cli {
1941
#[arg(
@@ -33,10 +55,15 @@ pub struct Cli {
3355
pub enum Commands {
3456
/// Authenticate with a provider via browser sign-in
3557
Login(login::LoginCommand),
58+
/// Create devopster-config.yaml interactively and optionally sign in
3659
Init(init::InitCommand),
60+
/// List, audit, scaffold, and sync repositories
3761
Repo(repo::RepoCommand),
62+
/// Generate a machine-readable org catalog (catalog.json)
3863
Catalog(catalog::CatalogCommand),
64+
/// Add missing template topics to every matching repository
3965
Topics(topics::TopicsCommand),
66+
/// Print org-wide metadata coverage, compliance, and top topics
4067
Stats(stats::StatsCommand),
4168
}
4269

src/cli/repo.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,13 @@ pub struct RepoCommand {
1414

1515
#[derive(Debug, Subcommand)]
1616
pub enum RepoAction {
17+
/// List all repositories; use --topic to filter
1718
List(ListReposCommand),
19+
/// Audit repositories against the policy defined in devopster-config.yaml
1820
Audit(AuditReposCommand),
21+
/// Push files from a local directory to all matching repositories
1922
Sync(SyncReposCommand),
23+
/// Create a new repository from a named template
2024
Scaffold(ScaffoldRepoCommand),
2125
}
2226

src/cli/topics.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pub struct TopicsCommand {
1313

1414
#[derive(Debug, Subcommand)]
1515
pub enum TopicsAction {
16+
/// Add any missing template topics to every matching repository
1617
Align(AlignTopicsCommand),
1718
}
1819

0 commit comments

Comments
 (0)