diff options
| author | Vladislav Stepanov <8uk.8ak@gmail.com> | 2023-04-14 23:18:58 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-14 20:18:58 +0100 |
| commit | c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d (patch) | |
| tree | 2c44a44eda7e76fa74e78ac1fd02f55c1ed4d804 /src/command/mod.rs | |
| parent | Switch to uuidv7 (#864) (diff) | |
| download | atuin-c05d2850420a2c163b8f62c33a6cef7c0ae1ad8d.zip | |
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.
Diffstat (limited to 'src/command/mod.rs')
| -rw-r--r-- | src/command/mod.rs | 87 |
1 files changed, 0 insertions, 87 deletions
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<String>, - }, -} - -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(()) - } - } - } -} |
