You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The stellar-xdr cli (which is also the stellar xdr command in the stellar-cli) accepts as input xdr either via file or stdin.
e.g. via file:
stellar xdr decode myfile.xdr myfile2.xdr
e.g. via stdin:
cat myfile.xdr | stellar xdr decode
echo ... | stellar xdr decode
It's been reported that it would be convenient if the command provided a way to pass the xdr as an argument as well.
When the command was first implemented passing the xdr as an argument was omitted because in bash-like environments you get that functionality for free.
e.g.
stellar xdr decode <(echo ...)
However, the stellar-cli is supported across a variety of environments, including Windows, where bash may not be in use. For the sake of making the cli consistently usable on all environments, which simplifies tutorials and teaching material (e.g. conference slides), we could add the ability to pass the xdr as an argument.
We should only do this if it doesn't make the rest of the UX more complex, and only if this is high impact enough.
# existing behaviour preserved
stellar xdr decode myfile.xdr myfile2.xdr # assumes file because files passed
cat myfile.xdr | stellar xdr decode # assumes stdin because no files givenecho ... | stellar xdr decode # assumes stdin because no files given# new behavior added
stellar xdr decode AAAAAAjBALVT2rv9LPtsuKN2lrdTALY5naljcz5sujEVXHX6
Where the command guesses if the input is XDR or a file by both trying to decode the input, as well as checking if a file exists by that name.
This is probably the best user experience, although I don't love the unpredictable behavior. But it is probably the best UX. In situations where the input is valid XDR and a file present on disk, it may be wise to output a warning to stderr about which is being used.
The stellar-xdr cli (which is also the stellar xdr command in the stellar-cli) accepts as input xdr either via file or stdin.
e.g. via file:
e.g. via stdin:
cat myfile.xdr | stellar xdr decode
It's been reported that it would be convenient if the command provided a way to pass the xdr as an argument as well.
When the command was first implemented passing the xdr as an argument was omitted because in bash-like environments you get that functionality for free.
e.g.
stellar xdr decode <(echo ...)
However, the stellar-cli is supported across a variety of environments, including Windows, where bash may not be in use. For the sake of making the cli consistently usable on all environments, which simplifies tutorials and teaching material (e.g. conference slides), we could add the ability to pass the xdr as an argument.
We should only do this if it doesn't make the rest of the UX more complex, and only if this is high impact enough.
cc @stellar/devx @tomerweller
The text was updated successfully, but these errors were encountered: