forked from GitoxideLabs/gitoxide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuni.rs
25 lines (22 loc) · 939 Bytes
/
uni.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! An experiment to see how a multi-call binary could look like.
//! For CI this would mean longer compile times though as it rebuilds `gix`
//! with varying compile flags, which also means that it recompiles all source or `ein`.
//!
//! However, doing this could be interesting for distribution if the files are hard-linked
//! instead of copied, which is why it is left here.
#![deny(unsafe_code, rust_2018_idioms)]
use anyhow::{bail, Result};
#[cfg(feature = "pretty-cli")]
fn main() -> Result<()> {
match std::env::current_exe()?
.file_stem()
.and_then(|stem| stem.to_str())
.unwrap_or("gix")
{
"gix" => crate::plumbing::main(),
"ein" => crate::porcelain::main(),
unknown => bail!("Executable named '{unknown}' cannot be launched. Exe must be named either `gix` or `ein`."),
}
}
#[cfg(not(feature = "pretty-cli"))]
compile_error!("Please set 'pretty-cli' feature flag");