aboutsummaryrefslogtreecommitdiffstats
path: root/atuin-client/src
diff options
context:
space:
mode:
authorConrad Ludgate <conradludgate@gmail.com>2022-09-11 16:24:16 +0100
committerGitHub <noreply@github.com>2022-09-11 16:24:16 +0100
commit702a644f68c687142c9a03b48cf451665ed41b62 (patch)
tree5621dc20001662f556532745d800ed5dc3607673 /atuin-client/src
parentAdd index for interactive search (#493) (diff)
downloadatuin-702a644f68c687142c9a03b48cf451665ed41b62.zip
better cursor search (#473)
* improve cursor code * proper unicode support * refactor and test * fmt * clippy * move methods to state * refactor search modules
Diffstat (limited to 'atuin-client/src')
-rw-r--r--atuin-client/src/database.rs2
-rw-r--r--atuin-client/src/settings.rs19
2 files changed, 16 insertions, 5 deletions
diff --git a/atuin-client/src/database.rs b/atuin-client/src/database.rs
index 7b3ab3be..ba28daf3 100644
--- a/atuin-client/src/database.rs
+++ b/atuin-client/src/database.rs
@@ -461,7 +461,7 @@ mod test {
Some("beep boop".to_string()),
Some("booop".to_string()),
);
- return db.save(&history).await;
+ db.save(&history).await
}
#[tokio::test(flavor = "multi_thread")]
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs
index d8720574..f836ce02 100644
--- a/atuin-client/src/settings.rs
+++ b/atuin-client/src/settings.rs
@@ -27,16 +27,27 @@ pub enum SearchMode {
#[derive(Clone, Debug, Deserialize, Copy, PartialEq, Eq)]
pub enum FilterMode {
#[serde(rename = "global")]
- Global,
+ Global = 0,
#[serde(rename = "host")]
- Host,
+ Host = 1,
#[serde(rename = "session")]
- Session,
+ Session = 2,
#[serde(rename = "directory")]
- Directory,
+ Directory = 3,
+}
+
+impl FilterMode {
+ pub fn as_str(&self) -> &'static str {
+ match self {
+ FilterMode::Global => "GLOBAL",
+ FilterMode::Host => "HOST",
+ FilterMode::Session => "SESSION",
+ FilterMode::Directory => "DIRECTORY",
+ }
+ }
}
// FIXME: Can use upstream Dialect enum if https://github.com/stevedonovan/chrono-english/pull/16 is merged