Skip to content

Commit be1fa2f

Browse files
committed
Remove dead code from non-existent "lean-cli" feature
1 parent bb3224c commit be1fa2f

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/shared.rs

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -270,28 +270,6 @@ pub fn setup_line_renderer_range(
270270
)
271271
}
272272

273-
#[cfg(all(feature = "lean-cli", not(feature = "pretty-cli")))]
274-
pub fn from_env<T: argh::TopLevelCommand>() -> T {
275-
static VERSION: &str = concat!(env!("CARGO_PKG_NAME"), " ", env!("CARGO_PKG_VERSION"));
276-
let strings: Vec<String> = std::env::args().collect();
277-
let strs: Vec<&str> = strings.iter().map(|s| s.as_str()).collect();
278-
T::from_args(&[strs[0]], &strs[1..]).unwrap_or_else(|early_exit| {
279-
// This allows us to make subcommands mandatory,
280-
// and trigger a helpful message unless --version is specified
281-
if let Some(arg) = std::env::args().nth(1) {
282-
if arg == "--version" {
283-
println!("{}", VERSION);
284-
std::process::exit(0);
285-
}
286-
}
287-
println!("{}", early_exit.output);
288-
std::process::exit(match early_exit.status {
289-
Ok(()) => 0,
290-
Err(()) => 1,
291-
})
292-
})
293-
}
294-
295273
mod clap {
296274
use std::{ffi::OsStr, str::FromStr};
297275

0 commit comments

Comments
 (0)