summaryrefslogtreecommitdiffstats
path: root/src/command/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/command/mod.rs')
-rw-r--r--src/command/mod.rs42
1 files changed, 38 insertions, 4 deletions
diff --git a/src/command/mod.rs b/src/command/mod.rs
index 805ad9f0..78e6402e 100644
--- a/src/command/mod.rs
+++ b/src/command/mod.rs
@@ -47,12 +47,27 @@ pub enum AtuinCmd {
#[structopt(long, short, about = "filter search result by directory")]
cwd: Option<String>,
+ #[structopt(long = "exclude-cwd", about = "exclude directory from results")]
+ exclude_cwd: Option<String>,
+
#[structopt(long, short, about = "filter search result by exit code")]
exit: Option<i64>,
+ #[structopt(long = "exclude-exit", about = "exclude results with this exit code")]
+ exclude_exit: Option<i64>,
+
+ #[structopt(long, short, about = "only include results added before this date")]
+ before: Option<String>,
+
+ #[structopt(long, about = "only include results after this date")]
+ after: Option<String>,
+
#[structopt(long, short, about = "open interactive search UI")]
interactive: bool,
+ #[structopt(long, short, about = "use human-readable formatting for time")]
+ human: bool,
+
query: Vec<String>,
},
@@ -79,20 +94,39 @@ impl AtuinCmd {
let db_path = PathBuf::from(client_settings.db_path.as_str());
- let mut db = Sqlite::new(db_path)?;
+ let mut db = Sqlite::new(db_path).await?;
match self {
Self::History(history) => history.run(&client_settings, &mut db).await,
- Self::Import(import) => import.run(&mut db),
+ Self::Import(import) => import.run(&mut db).await,
Self::Server(server) => server.run(&server_settings).await,
- Self::Stats(stats) => stats.run(&mut db, &client_settings),
+ Self::Stats(stats) => stats.run(&mut db, &client_settings).await,
Self::Init => init::init(),
Self::Search {
cwd,
exit,
interactive,
+ human,
+ exclude_exit,
+ exclude_cwd,
+ before,
+ after,
query,
- } => search::run(cwd, exit, interactive, &query, &mut db),
+ } => {
+ search::run(
+ cwd,
+ exit,
+ interactive,
+ human,
+ exclude_exit,
+ exclude_cwd,
+ before,
+ after,
+ &query,
+ &mut db,
+ )
+ .await
+ }
Self::Sync { force } => sync::run(&client_settings, force, &mut db).await,
Self::Login(l) => l.run(&client_settings),