Factor usage of common error type more

This commit is contained in:
Dominik Werder
2021-12-08 13:20:07 +01:00
parent c39af81097
commit 3c64eafd14
56 changed files with 751 additions and 354 deletions

42
dq/src/bin/dq.rs Normal file
View File

@@ -0,0 +1,42 @@
// TODO crate `err` pulls in all other dependencies in order to implement From<...> for Error.
// Refactor that...
// Crate `taskrun` also depends on `err`...
use std::path::PathBuf;
use err::Error;
#[derive(Debug)]
pub struct Error2;
use clap::{crate_version, Parser};
#[derive(Debug, Parser)]
#[clap(name="DAQ tools", author="Dominik Werder <dominik.werder@psi.ch>", version=crate_version!())]
pub struct Opts {
#[clap(short, long, parse(from_occurrences))]
pub verbose: i32,
#[clap(subcommand)]
pub subcmd: SubCmd,
}
#[derive(Debug, Parser)]
pub enum SubCmd {
ConvertArchiverApplianceChannel(ConvertArchiverApplianceChannel),
}
#[derive(Debug, Parser)]
pub struct ConvertArchiverApplianceChannel {
name: String,
#[clap(about = "Look for archiver appliance data at given path")]
input_dir: PathBuf,
#[clap(about = "Generate Databuffer format at given path")]
output_dir: PathBuf,
}
pub fn main() -> Result<(), Error> {
//taskrun::run(async { Ok(()) })
let opts = Opts::parse();
eprintln!("Opts: {:?}", opts);
Err(Error::with_msg_no_trace(format!("123")))
}

1
dq/src/dq.rs Normal file
View File

@@ -0,0 +1 @@