discv5_cli/packet/
command.rs

1use clap::{Args, Subcommand as ClapSubcommand};
2
3/// Packet Command
4#[derive(Args, Clone, Debug)]
5pub struct Packet {
6    /// Packet Subcommand
7    #[clap(subcommand)]
8    pub subcommand: PacketSubcommand,
9}
10
11/// Packet Subcommand
12#[derive(ClapSubcommand, Clone, Debug)]
13pub enum PacketSubcommand {
14    /// Decodes a packet.
15    Decode(Decode),
16}
17
18/// Decode Options
19#[derive(Args, Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
20pub struct Decode {
21    /// The packet to be decoded as a hex string.
22    #[clap(
23        short = 'p',
24        long = "packet",
25        help = "The packet to be decoded as a hex string."
26    )]
27    pub packet: String,
28    /// The node id of the destination of this packet to determine WHOAREYOU packets as a hex string.
29    #[clap(
30        short = 'n',
31        long = "nodeid",
32        help = "The node id of the destination of this packet to determine WHOAREYOU packets as a hex string."
33    )]
34    pub node_id: String,
35}