stellar_xdr/cli/
generate.rs1pub mod arbitrary;
2pub mod default;
3
4use clap::{Args, Subcommand};
5
6#[derive(thiserror::Error, Debug)]
7pub enum Error {
8 #[error("{0}")]
9 Default(#[from] default::Error),
10 #[error("{0}")]
11 Arbitrary(#[from] arbitrary::Error),
12}
13
14#[derive(Args, Debug, Clone)]
16#[command()]
17pub struct Cmd {
18 #[command(subcommand)]
19 pub sub: Sub,
20}
21
22#[derive(Subcommand, Clone, Debug)]
23pub enum Sub {
24 Default(default::Cmd),
25 Arbitrary(arbitrary::Cmd),
26}
27
28impl Cmd {
29 pub fn run(&self) -> Result<(), Error> {
39 match &self.sub {
40 Sub::Default(c) => c.run()?,
41 Sub::Arbitrary(c) => c.run()?,
42 }
43 Ok(())
44 }
45}