diff options
author | Toby Vincent <tobyv13@gmail.com> | 2022-11-30 03:11:38 -0600 |
---|---|---|
committer | Toby Vincent <tobyv13@gmail.com> | 2022-11-30 03:11:38 -0600 |
commit | 47fe04dfb634eba3c24403013cf92960237cf761 (patch) | |
tree | c3fc4e3f8a480af8fb9020e000cdc391c840eaa2 /src/cli.rs | |
parent | fa956cc1598f69c81d6db54b4e2e8f5f35cd9b23 (diff) |
revert: remove figment from the lib (moved to bin)
Diffstat (limited to 'src/cli.rs')
-rw-r--r-- | src/cli.rs | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -1,10 +1,9 @@ use clap::{Args, Parser}; -use figment::{value, Metadata, Profile, Provider}; use serde::{Deserialize, Serialize}; use std::path::PathBuf; use tracing::{metadata::LevelFilter, Level}; -use crate::{config::Entry, Config}; +use crate::{config::SearchEntryConfig, Config}; /// Tool for listing project directories. #[derive(Debug, Clone, Default, Parser, Serialize, Deserialize)] @@ -48,23 +47,13 @@ pub struct Projects { git: bool, } -impl Provider for Projects { - fn metadata(&self) -> Metadata { - Metadata::named("Projectr cli provider") - } - - fn data(&self) -> figment::error::Result<value::Map<Profile, value::Dict>> { - Config::from(self.to_owned()).data() - } -} - impl From<Projects> for Config { fn from(value: Projects) -> Self { let paths = value .paths .iter() .cloned() - .map(|path_buf| Entry { + .map(|path_buf| SearchEntryConfig { path_buf, hidden: value.hidden, max_depth: value.max_depth, |