Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/stellar-scaffold-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ impl FromStr for Root {
pub enum Cmd {
/// Initialize the project
Init(init::Cmd),
/// Version of the scaffold-stellar-cli
/// Version of the stellar-scaffold-cli
Version(version::Cmd),

/// Build contracts, resolving dependencies in the correct order. If you have an `environments.toml` file, it will also follow its instructions to configure the environment set by the `STELLAR_SCAFFOLD_ENV` environment variable, turning your contracts into frontend packages (JS dependencies).
Expand Down
23 changes: 22 additions & 1 deletion crates/stellar-scaffold-cli/src/commands/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct Cmd;
impl Cmd {
#[allow(clippy::unused_self)]
pub fn run(&self) {
println!("scaffold {}", long());
println!("stellar-scaffold {}", long());
}
}

Expand Down Expand Up @@ -38,3 +38,24 @@ xdr ({})",
]
.join("\n")
}

#[cfg(test)]
mod tests {
use clap::CommandFactory;

#[test]
fn help_uses_the_current_package_name() {
let mut root = crate::commands::Root::command();
let about = root
.find_subcommand("version")
.and_then(|version| version.get_about())
.map(ToString::to_string)
.unwrap_or_default();
assert_eq!(about, "Version of the stellar-scaffold-cli");
let help = root.render_long_help().to_string();
assert!(
!help.contains("scaffold-stellar"),
"old package name in help:\n{help}"
);
}
}
Loading