(c28bc04) Report the version and the commit it was built from
worklane --version exited 2: the Cli derive set name and about but never
version, so clap generated no flag. Nothing could say what a given binary
was, which matters here because the opencode tools shell out to whatever
worklane is on PATH, so an agent can be driving a stale build with no way
to notice.
The crate version alone would not have answered it. Cargo.toml is pinned
at 0.1.0 and nobody bumps it per install, so a stale install and a fresh
build both claim the same thing. A build script stamps the short sha
alongside it, giving "worklane 0.1.0 (df97b06)", and falls back to
"unknown" where there is no git directory, as when installing from a
published crate.
propagate_version lets subcommands answer too. This overrides the ticket's
own plan step, which said to skip the sha if it needed a build script.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
df97b06275
commit
32a43b5201
@@ -1,8 +1,17 @@
|
||||
use clap::Parser;
|
||||
|
||||
/// What `--version` prints: the crate version and the commit it was built from.
|
||||
///
|
||||
/// The sha is the part that matters. Two binaries built weeks apart both call
|
||||
/// themselves 0.1.0, so without it there is no way to tell whether the copy on
|
||||
/// PATH is the one carrying a given fix.
|
||||
const VERSION: &str = concat!(env!("CARGO_PKG_VERSION"), " (", env!("WORKLANE_GIT_SHA"), ")");
|
||||
|
||||
#[derive(Parser)]
|
||||
#[command(name = "worklane")]
|
||||
#[command(about = "A CLI tool for managing project status")]
|
||||
#[command(version = VERSION)]
|
||||
#[command(propagate_version = true)]
|
||||
pub struct Cli {
|
||||
#[command(subcommand)]
|
||||
pub command: Command,
|
||||
|
||||
Reference in New Issue
Block a user