remove old unused files for now
This commit is contained in:
parent
8dba8e7ce8
commit
8a6bd41baa
15 changed files with 35 additions and 1804 deletions
48
src/main.rs
48
src/main.rs
|
|
@ -1,48 +0,0 @@
|
|||
use std::io::{self, IsTerminal};
|
||||
use std::process::ExitCode;
|
||||
use std::{error::Error as StdError, sync::Arc};
|
||||
|
||||
use clap::{ColorChoice, Parser as _};
|
||||
use tracing_human_layer::HumanLayer;
|
||||
use tracing_subscriber::util::SubscriberInitExt;
|
||||
use tracing_subscriber::{EnvFilter, layer::SubscriberExt};
|
||||
|
||||
fn main_wrapped() -> Result<(), Box<dyn StdError + Send + Sync + 'static>> {
|
||||
let args = Arc::new(dynix::Args::parse());
|
||||
|
||||
let success = dynix::_CLI_ENABLE_COLOR.set(match args.color {
|
||||
ColorChoice::Always => true,
|
||||
ColorChoice::Auto => io::stdin().is_terminal(),
|
||||
ColorChoice::Never => false,
|
||||
});
|
||||
if cfg!(debug_assertions) {
|
||||
success.expect("logic error in CLI_ENABLE_COLOR");
|
||||
}
|
||||
|
||||
tracing_subscriber::registry()
|
||||
.with(HumanLayer::new().with_color_output(*dynix::SHOULD_COLOR))
|
||||
.with(EnvFilter::from_default_env())
|
||||
.init();
|
||||
|
||||
tracing::debug!("Parsed command-line arguments: {args:?}");
|
||||
|
||||
{
|
||||
use dynix::args::Subcommand::*;
|
||||
match &args.subcommand {
|
||||
Append(append_args) => dynix::do_append(args.clone(), append_args.clone())?,
|
||||
Delta(delta_args) => dynix::do_delta(args.clone(), delta_args.clone())?,
|
||||
};
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn main() -> ExitCode {
|
||||
match main_wrapped() {
|
||||
Ok(_) => ExitCode::SUCCESS,
|
||||
Err(e) => {
|
||||
eprintln!("dynix: error: {}", e);
|
||||
ExitCode::FAILURE
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue