* WIP deep rename (not for push) * WIP2 * WIP3 * WIP4 wxs fix * rustfmt * Rename the remaining identifiers in merged crash-report code Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
31 lines
1.5 KiB
Rust
31 lines
1.5 KiB
Rust
//! `solvecraft-cli`: the CLI's former name, kept for at least one release so existing scripts
|
|
//! and MCP client setups (`claude mcp add solvecraft -- solvecraft-cli mcp`) keep working.
|
|
//! Compatibility shim: it runs `solidcraft-cli` (next to this executable, else on PATH) with the
|
|
//! same arguments and standard streams, after a one-line deprecation note on stderr (stdout
|
|
//! stays clean for MCP's JSON-RPC), and exits with its status.
|
|
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
|
#![forbid(unsafe_code)]
|
|
|
|
use std::process::{Command, ExitCode};
|
|
|
|
const TARGET: &str = "solidcraft-cli";
|
|
|
|
fn main() -> ExitCode {
|
|
eprintln!("solvecraft-cli is deprecated and will be removed in a later release: use solidcraft-cli");
|
|
let sibling = std::env::current_exe()
|
|
.ok()
|
|
.and_then(|exe| exe.parent().map(|dir| dir.join(format!("{TARGET}{}", std::env::consts::EXE_SUFFIX))))
|
|
.filter(|p| p.is_file());
|
|
let program = sibling.map(|p| p.into_os_string()).unwrap_or_else(|| TARGET.into());
|
|
match Command::new(&program).args(std::env::args_os().skip(1)).status() {
|
|
Ok(status) => match status.code() {
|
|
Some(code) => ExitCode::from(u8::try_from(code).unwrap_or(1)),
|
|
None => ExitCode::FAILURE,
|
|
},
|
|
Err(e) => {
|
|
eprintln!("solvecraft-cli: could not run {}: {e}", program.to_string_lossy());
|
|
ExitCode::FAILURE
|
|
}
|
|
}
|
|
}
|