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
{{ message }}
Repository navigation
stellar contract alias ls command outputs info lines to stdout instead of stderr and ignores -q #1971
Tried to run the contract alias ls command without additional informational output.
First using the -q option:
stellar contract alias ls 2&>/dev/null
Then by redirecting stderr to /dev/null:
stellar contract alias ls 2&>/dev/null
What did you expect to see?
The informational output to be suppressed or not visible.
$ stellar contract alias ls -q
abc: CD27DJQ4P2FXFLYFRUQQ5SSXBOZGMWPYITW7OFCDXO5G32B52KZYZC7T
def: CCUBWUQ6WMU3MTZRM5PQQ62BTTAIQTOGVXDRG4K5LYS6JLRUIM5RHWFI
$ stellar contract alias ls 2&>/dev/null
abc: CD27DJQ4P2FXFLYFRUQQ5SSXBOZGMWPYITW7OFCDXO5G32B52KZYZC7T
def: CCUBWUQ6WMU3MTZRM5PQQ62BTTAIQTOGVXDRG4K5LYS6JLRUIM5RHWFI
What did you see instead?
The informational output was still visible, being written to stdout.
$ stellar contract alias ls -q
ℹ️ Aliases available for network 'Test SDF Network ; September 2015'
abc: CD27DJQ4P2FXFLYFRUQQ5SSXBOZGMWPYITW7OFCDXO5G32B52KZYZC7T
def: CCUBWUQ6WMU3MTZRM5PQQ62BTTAIQTOGVXDRG4K5LYS6JLRUIM5RHWFI
$ stellar contract alias ls 2&>/dev/null
ℹ️ Aliases available for network 'Test SDF Network ; September 2015'
abc: CD27DJQ4P2FXFLYFRUQQ5SSXBOZGMWPYITW7OFCDXO5G32B52KZYZC7T
def: CCUBWUQ6WMU3MTZRM5PQQ62BTTAIQTOGVXDRG4K5LYS6JLRUIM5RHWFI
I think this is the correct behavior. We can't just show the contract ids without the network context.
$ stellar contract alias ls 2> /dev/nullℹ️ Aliases available for network 'Test SDF Network ; September 2015'hello: CAC7DZGDT6BNRXDP3HAVAZY4JURE6FHGPL6K63AMX6RMEUUJVN3RQYONℹ️ Aliases available for network 'Standalone Network ; February 2017'local: CASWADSMLMJR2HQFDFEOZH2K4XKQWUMN6FFE3I5KTFXNQ5TM2KDWU26U
We can open a new ticket for it, but also, I doubt this is a frequent need. I was doing something... rare at the time. I think it's fine to wait for someone to ask for it.
Activity
fnando commentedon Aug 1, 2025
I think this is the correct behavior. We can't just show the contract ids without the network context.
leighmcculloch commentedon Aug 1, 2025
I was hoping those lines would be sent to stderr, because I was trying to script the output and parse it to select something.
But that's a good point, without the network context it's a little dubious how useful that would be.
fnando commentedon Aug 1, 2025
Maybe we should repurpose the ticket to be something like adding support for json output, because it's more scripting-friendly.
leighmcculloch commentedon Aug 1, 2025
We can open a new ticket for it, but also, I doubt this is a frequent need. I was doing something... rare at the time. I think it's fine to wait for someone to ask for it.