diff options
| author | 2026-02-27 23:52:28 -0500 | |
|---|---|---|
| committer | 2026-02-27 23:52:28 -0500 | |
| commit | 0c70155f2c30fa84802f6dc9b893716878437295 (patch) | |
| tree | e8950e9e6dc7a47ac8a5b909e9a54be10a5afccc /src/action.rs | |
| parent | upgrade function added (diff) | |
added show command
Diffstat (limited to '')
| -rw-r--r-- | src/action.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/action.rs b/src/action.rs index f8504f2..735516e 100644 --- a/src/action.rs +++ b/src/action.rs @@ -1,4 +1,4 @@ -use crate::config::{self, ConfigCommand, TEMP_CONFIG_PATH, create_config}; +use crate::config::{self, Config, ConfigCommand, TEMP_CONFIG_PATH, create_config}; use crate::util::{dir_size, get_editor, open_in_editor, pull_repo, yn_prompt}; use git2::Repository; use std::fs; @@ -72,7 +72,7 @@ impl Action { Action::List => list(), Action::Search { term } => Ok(search(term)), Action::Clean { packages } => clean(packages), - Action::Show { package } => Ok(show(package)), + Action::Show { package } => show(package), Action::Version => Ok(version()), } } @@ -374,8 +374,11 @@ fn clean(packages: Vec<String>) -> Result<(), String> { Ok(()) } -fn show(package: String) { - println!("showing {}", package); +fn show(package: String) -> Result<(), String> { + let config_path = PathBuf::from(BASE_CONFIG_PATH).join(format!("{package}.toml")); + let config = Config::new(&config_path).ok_or("config not found".to_string())?; + config.log_config(); + Ok(()) } fn version() { |
