use super::locator;
use clap::command;
#[derive(thiserror::Error, Debug)]
pub enum Error {
#[error(transparent)]
Config(#[from] locator::Error),
}
#[derive(Debug, clap::Parser, Clone)]
#[group(skip)]
pub struct Cmd {
#[command(flatten)]
pub config_locator: locator::Args,
}
impl Cmd {
pub fn run(&self) -> Result<(), Error> {
let res = self.ls()?;
println!("{}", res.join("\n"));
Ok(())
}
pub fn ls(&self) -> Result<Vec<String>, Error> {
Ok(self.config_locator.list_networks()?)
}
}