-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use stellar_xdr::cli at top level
xdr
- Loading branch information
1 parent
bee1f45
commit dd22eb0
Showing
5 changed files
with
85 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use clap::Parser; | ||
use std::ffi::OsString; | ||
use stellar_xdr::cli; | ||
|
||
pub use cli::Error; | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct Cmd { | ||
pub slop: Vec<OsString>, | ||
} | ||
|
||
impl Cmd { | ||
pub fn run(&self) -> Result<(), Error> { | ||
cli::run(&self.slop) | ||
} | ||
} | ||
|
||
pub fn try_cmd() -> Result<(), Error> { | ||
let mut args = std::env::args().peekable(); | ||
args.next().unwrap(); | ||
if let Some(s) = args.peek() { | ||
if s == "xdr" { | ||
stellar_xdr::cli::run(args)?; | ||
std::process::exit(0); | ||
} | ||
} | ||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters