diff options
| author | Yuvi Panda <yuvipanda@gmail.com> | 2021-05-09 13:03:56 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-09 08:33:56 +0100 |
| commit | 19bd00f62005d07fc22ef72558e1102a7bb13b03 (patch) | |
| tree | 818aaf786755e37aec2dcfa40ea938f42edc72db /atuin-client/src/settings.rs | |
| parent | Retain the query entered into the TUI (#76) (diff) | |
| download | atuin-19bd00f62005d07fc22ef72558e1102a7bb13b03.zip | |
Support fulltext search of commands (#75)
Diffstat (limited to 'atuin-client/src/settings.rs')
| -rw-r--r-- | atuin-client/src/settings.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 4ea4be84..7ccbaf32 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -10,6 +10,15 @@ use parse_duration::parse; pub const HISTORY_PAGE_SIZE: i64 = 100; +#[derive(Clone, Debug, Deserialize, Copy)] +pub enum SearchMode { + #[serde(rename = "prefix")] + Prefix, + + #[serde(rename = "fulltext")] + FullText, +} + #[derive(Clone, Debug, Deserialize)] pub struct Settings { pub dialect: String, @@ -19,6 +28,7 @@ pub struct Settings { pub db_path: String, pub key_path: String, pub session_path: String, + pub search_mode: SearchMode, // This is automatically loaded when settings is created. Do not set in // config! Keep secrets and settings apart. @@ -100,6 +110,7 @@ impl Settings { s.set_default("auto_sync", true)?; s.set_default("sync_frequency", "1h")?; s.set_default("sync_address", "https://api.atuin.sh")?; + s.set_default("search_mode", "prefix")?; if config_file.exists() { s.merge(ConfigFile::with_name(config_file.to_str().unwrap()))?; |
