diff options
Diffstat (limited to 'src/command')
| -rw-r--r-- | src/command/mod.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/command/mod.rs b/src/command/mod.rs index 8d463bd6..4ac62385 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -1,4 +1,8 @@ +use eyre::Result; use structopt::StructOpt; +use uuid::Uuid; + +use crate::local::database::Sqlite; mod history; mod import; @@ -21,3 +25,18 @@ pub enum AtuinCmd { #[structopt(about = "generates a UUID")] Uuid, } + +impl AtuinCmd { + pub fn run(self, db: &mut Sqlite) -> Result<()> { + match self { + Self::History(history) => history.run(db), + Self::Import(import) => import.run(db), + Self::Server(server) => server.run(), + + Self::Uuid => { + println!("{}", Uuid::new_v4().to_simple().to_string()); + Ok(()) + } + } + } +} |
