diff --git a/src/args.rs b/src/args.rs index c1d8dcc..25f0cbc 100644 --- a/src/args.rs +++ b/src/args.rs @@ -67,6 +67,8 @@ pub enum GetCommands { PppStatus, /// Fetch LAN IP address. LanIpaddr, + /// Fetch local domain. + LocalDomain, /// Fetch firmware version. CrVersion, /// Fetch battery percentage. diff --git a/src/main.rs b/src/main.rs index 3fb44b6..eae67f8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,6 +32,7 @@ async fn main() -> EyreResult<()> { GetCommands::LteTac => router.show::().await?, GetCommands::NvArfcn => router.show::().await?, GetCommands::LanIpaddr => router.show::().await?, + GetCommands::LocalDomain => router.show::().await?, }, TopLevelCommands::Post { command } => match command { PostCommands::Reboot => router.reboot().await.print_table(), diff --git a/src/proc_get.rs b/src/proc_get.rs index 9bd6d58..6b60b24 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -342,6 +342,25 @@ impl ProcGet for LanIpaddr { } } +#[derive(Debug, Deserialize)] +pub struct LocalDomain { + #[serde(rename = "LocalDomain")] + pub local_domain: BoxStr, +} + +impl ProcGet for LocalDomain { + const CMD: &str = "LocalDomain"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + table + .set_header(["Local Domain"]) + .add_row([&self.local_domain]); + println!("{table}"); + } +} + #[derive(Debug, Deserialize)] pub struct CrVersion { pub cr_version: BoxStr,