Skip to content

Commit e59b6a4

Browse files
gmoonclaude
andcommitted
Show update notification on lattice --version
lattice --version was handled by clap directly, bypassing the passive update check. Now intercepted before clap parses so maybe_notify_update() runs after printing the version. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent de8388f commit e59b6a4

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/main.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,13 +1913,19 @@ fn print_grouped_help() {
19131913
}
19141914

19151915
fn main() {
1916-
// Intercept top-level --help/-h before clap parses, so subcommand --help
1917-
// still uses clap's built-in per-command help.
1916+
// Intercept top-level --help/-h and --version/-V before clap parses,
1917+
// so subcommand --help still uses clap's built-in per-command help,
1918+
// and --version can show the passive update notification.
19181919
let args: Vec<String> = std::env::args().collect();
19191920
if args.len() == 2 && (args[1] == "--help" || args[1] == "-h") {
19201921
print_grouped_help();
19211922
return;
19221923
}
1924+
if args.len() == 2 && (args[1] == "--version" || args[1] == "-V") {
1925+
println!("lattice {}", env!("CARGO_PKG_VERSION"));
1926+
lattice::update::maybe_notify_update(None);
1927+
return;
1928+
}
19231929

19241930
let cli = Cli::parse();
19251931

0 commit comments

Comments
 (0)