Skip to content

Commit f0a3d67

Browse files
gmoonclaude
andcommitted
Show update notification after help output, not before
The bare `lattice` command now renders help first, then shows the update notice at the bottom. Previously it showed at the top because Clap's --help exits the process. Uses render_help() to avoid the process exit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f45370e commit f0a3d67

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/main.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! Linked requirements: REQ-CLI-001 through REQ-CLI-005, REQ-CORE-009
44
5-
use clap::{Parser, Subcommand};
5+
use clap::{CommandFactory, Parser, Subcommand};
66
use colored::Colorize;
77
use lattice::{
88
AddEdgeOptions, AddImplementationOptions, AddRequirementOptions, AddSourceOptions,
@@ -1470,9 +1470,11 @@ fn main() {
14701470
let command = match cli.command {
14711471
Some(cmd) => cmd,
14721472
None => {
1473-
// Show update notification before help (Clap's --help exits the process)
1473+
// Render help without exiting so update notice can follow
1474+
let mut cmd = Cli::command();
1475+
let help = cmd.render_help();
1476+
println!("{}", help);
14741477
lattice::update::maybe_notify_update(None);
1475-
Cli::parse_from(["lattice", "--help"]);
14761478
return;
14771479
}
14781480
};

0 commit comments

Comments
 (0)