meowy-webring/cli/src/commands.rs

19 lines
406 B
Rust
Raw Normal View History

use crate::arguments::Group;
pub(crate) fn print(path: &String, group: &Group) {
let names = std::fs::read_to_string(path).unwrap();
let parsed_names = shared::names::load_names(names).unwrap();
for site in parsed_names {
if group.name {
println!("{}", site.name.unwrap_or_default());
continue;
}
if group.url {
println!("{}", site.url);
continue;
}
println!("{:?}", site);
}
}