[feat] add empty state message for models ls
command output
This commit is contained in:
@@ -128,12 +128,16 @@ fn main() -> Result<()> {
|
|||||||
ModelsCmd::Ls { common } => {
|
ModelsCmd::Ls { common } => {
|
||||||
let mm: ModelManager<ReqwestClient> = ModelManager::new(handle_common(&common))?;
|
let mm: ModelManager<ReqwestClient> = ModelManager::new(handle_common(&common))?;
|
||||||
let list = mm.ls()?;
|
let list = mm.ls()?;
|
||||||
if common.json {
|
if list.is_empty() {
|
||||||
println!("{}", serde_json::to_string_pretty(&list)?);
|
println!("No models installed.");
|
||||||
} else {
|
} else {
|
||||||
println!("Model (Repo)");
|
if common.json {
|
||||||
for r in list {
|
println!("{}", serde_json::to_string_pretty(&list)?);
|
||||||
println!("{} ({})", r.file, r.repo);
|
} else {
|
||||||
|
println!("Model (Repo)");
|
||||||
|
for r in list {
|
||||||
|
println!("{} ({})", r.file, r.repo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXIT_OK
|
EXIT_OK
|
||||||
|
Reference in New Issue
Block a user