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/mod.rs | 87 ------------------------------------------------------ 1 file changed, 87 deletions(-) delete mode 100644 src/command/mod.rs (limited to 'src/command/mod.rs') diff --git a/src/command/mod.rs b/src/command/mod.rs deleted file mode 100644 index 4ed1691a..00000000 --- a/src/command/mod.rs +++ /dev/null @@ -1,87 +0,0 @@ -use clap::{CommandFactory, Subcommand}; -use clap_complete::{generate, generate_to, Shell}; -use eyre::Result; - -#[cfg(feature = "client")] -mod client; - -#[cfg(feature = "server")] -mod server; - -mod init; - -mod contributors; - -#[derive(Subcommand)] -#[command(infer_subcommands = true)] -pub enum AtuinCmd { - #[cfg(feature = "client")] - #[command(flatten)] - Client(client::Cmd), - - /// Start an atuin server - #[cfg(feature = "server")] - #[command(subcommand)] - Server(server::Cmd), - - /// Output shell setup - Init(init::Cmd), - - /// Generate a UUID - Uuid, - - Contributors, - - /// Generate shell completions - GenCompletions { - /// Set the shell for generating completions - #[arg(long, short)] - shell: Shell, - - /// Set the output directory - #[arg(long, short)] - out_dir: Option, - }, -} - -impl AtuinCmd { - pub fn run(self) -> Result<()> { - match self { - #[cfg(feature = "client")] - Self::Client(client) => client.run(), - #[cfg(feature = "server")] - Self::Server(server) => server.run(), - Self::Contributors => { - contributors::run(); - Ok(()) - } - Self::Init(init) => { - init.run(); - Ok(()) - } - Self::Uuid => { - println!("{}", atuin_common::utils::uuid_v7().as_simple()); - Ok(()) - } - Self::GenCompletions { shell, out_dir } => { - let mut cli = crate::Atuin::command(); - - match out_dir { - Some(out_dir) => { - generate_to(shell, &mut cli, env!("CARGO_PKG_NAME"), &out_dir)?; - } - None => { - generate( - shell, - &mut cli, - env!("CARGO_PKG_NAME"), - &mut std::io::stdout(), - ); - } - } - - Ok(()) - } - } - } -} -- cgit v1.3.1