[feat] add empty state message for models ls
command output
This commit is contained in:
@@ -128,6 +128,9 @@ 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 list.is_empty() {
|
||||||
|
println!("No models installed.");
|
||||||
|
} else {
|
||||||
if common.json {
|
if common.json {
|
||||||
println!("{}", serde_json::to_string_pretty(&list)?);
|
println!("{}", serde_json::to_string_pretty(&list)?);
|
||||||
} else {
|
} else {
|
||||||
@@ -136,6 +139,7 @@ fn main() -> Result<()> {
|
|||||||
println!("{} ({})", r.file, r.repo);
|
println!("{} ({})", r.file, r.repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
EXIT_OK
|
EXIT_OK
|
||||||
}
|
}
|
||||||
ModelsCmd::Add { repo, file, common } => {
|
ModelsCmd::Add { repo, file, common } => {
|
||||||
|
Reference in New Issue
Block a user