From c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d Mon Sep 17 00:00:00 2001 From: Vladislav Stepanov <8uk.8ak@gmail.com> Date: Fri, 14 Apr 2023 23:18:58 +0400 Subject: Workspace reorder (#868) * Try different workspace structure Move main crate (atuin) to be on the same level with other crates in this workspace * extract common dependencies to the workspace definition * fix base64 v0.21 deprecation warning * questionable: update deps & fix chrono deprecations possible panic sites are unchanged, they're just more visible now * Revert "questionable: update deps & fix chrono deprecations" This reverts commit 993e60f8dea81a1625a04285a617959ad09a0866. --- src/command/client.rs | 61 --------------------------------------------------- 1 file changed, 61 deletions(-) delete mode 100644 src/command/client.rs (limited to 'src/command/client.rs') diff --git a/src/command/client.rs b/src/command/client.rs deleted file mode 100644 index 2a825638..00000000 --- a/src/command/client.rs +++ /dev/null @@ -1,61 +0,0 @@ -use std::path::PathBuf; - -use clap::Subcommand; -use eyre::{Result, WrapErr}; - -use atuin_client::{database::Sqlite, settings::Settings}; -use env_logger::Builder; - -#[cfg(feature = "sync")] -mod sync; - -mod history; -mod import; -mod search; -mod stats; - -#[derive(Subcommand)] -#[command(infer_subcommands = true)] -pub enum Cmd { - /// Manipulate shell history - #[command(subcommand)] - History(history::Cmd), - - /// Import shell history from file - #[command(subcommand)] - Import(import::Cmd), - - /// Calculate statistics for your history - Stats(stats::Cmd), - - /// Interactive history search - Search(search::Cmd), - - #[cfg(feature = "sync")] - #[command(flatten)] - Sync(sync::Cmd), -} - -impl Cmd { - #[tokio::main(flavor = "current_thread")] - pub async fn run(self) -> Result<()> { - Builder::new() - .filter_level(log::LevelFilter::Off) - .parse_env("ATUIN_LOG") - .init(); - - let mut settings = Settings::new().wrap_err("could not load client settings")?; - - let db_path = PathBuf::from(settings.db_path.as_str()); - let mut db = Sqlite::new(db_path).await?; - - match self { - Self::History(history) => history.run(&settings, &mut db).await, - Self::Import(import) => import.run(&mut db).await, - Self::Stats(stats) => stats.run(&mut db, &settings).await, - Self::Search(search) => search.run(db, &mut settings).await, - #[cfg(feature = "sync")] - Self::Sync(sync) => sync.run(settings, &mut db).await, - } - } -} -- cgit v1.3.1