stellar / rs-stellar-xdr

Rust lib for Stellar XDR.
Apache License 2.0
20 stars 27 forks source link

cli: Automatically decode guess when decode does not have type specified #350

Open leighmcculloch opened 8 months ago

leighmcculloch commented 8 months ago

What problem does your feature solve?

When the CLI is able to guess the type, it's unnecessary to ask the user to provide the type which is more typing.

What would you like to see?

That decode works without specifying the type if the type can be guessed:

$ echo -n '...' | stellar-xdr decode
...

Replacing this flow:

$ echo -n '...' | stellar-xdr guess
DiagnosticEvent

$ echo -n '...' | stellar-xdr decode --type DiagnosticEvent
...