Skip to content

stellar contract alias ls command outputs info lines to stdout instead of stderr and ignores -q #1971

Closed as not planned

Description

@leighmcculloch

What version are you using?

22.5.0

What did you do?

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

Activity

  1. added
    bug
    on Mar 18, 2025
  2. moved this to Backlog (Not Ready) in DevXon Mar 18, 2025
  3. fnando commented on Aug 1, 2025

    @fnando
    Member

    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
  4. leighmcculloch commented on Aug 1, 2025

    @leighmcculloch
    MemberAuthor

    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.

  5. moved this from Backlog (Not Ready) to Done in DevXon Aug 1, 2025
  6. fnando commented on Aug 1, 2025

    @fnando
    Member

    Maybe we should repurpose the ticket to be something like adding support for json output, because it's more scripting-friendly.

  7. leighmcculloch commented on Aug 1, 2025

    @leighmcculloch
    MemberAuthor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions