diff --git a/src/args.rs b/src/args.rs index 8433af0..d6b51a6 100644 --- a/src/args.rs +++ b/src/args.rs @@ -71,6 +71,8 @@ pub enum GetCommands { LocalDomain, /// Fetch DHCP start. DhcpStart, + /// Fetch DHCP end. + DhcpEnd, /// Fetch firmware version. CrVersion, /// Fetch battery percentage. diff --git a/src/main.rs b/src/main.rs index d5b729a..79cd56c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -34,6 +34,7 @@ async fn main() -> EyreResult<()> { GetCommands::LanIpaddr => router.show::().await?, GetCommands::LocalDomain => router.show::().await?, GetCommands::DhcpStart => router.show::().await?, + GetCommands::DhcpEnd => 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 88cb2e2..12241b1 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -378,6 +378,23 @@ impl ProcGet for DhcpStart { } } +#[derive(Debug, Deserialize)] +pub struct DhcpEnd { + #[serde(rename = "dhcpEnd")] + pub dhcp_end: BoxStr, +} + +impl ProcGet for DhcpEnd { + const CMD: &str = "dhcpEnd"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + table.set_header(["DHCP End"]).add_row([&self.dhcp_end]); + println!("{table}"); + } +} + #[derive(Debug, Deserialize)] pub struct CrVersion { pub cr_version: BoxStr,