Code Monkey home page Code Monkey logo

Comments (11)

phm07 avatar phm07 commented on September 22, 2024 2

Yes, I think the concern that you can't (easily) get error messages while ignoring stderr is still valid, so a --quiet flag is still useful IMO. Thanks for bringing this up for discussion 🙂

from cli.

jooola avatar jooola commented on September 22, 2024 1

I think it's worth adding some details about what is printed to stdout and stderr to the documentation/help page/manpage.

from cli.

itg-dave avatar itg-dave commented on September 22, 2024 1

This is intentional. Because the progress is printed in stderr, you can handle it separately. For example, this is how you would hide it entirely:

server request-console -o json 2>/dev/null

I don't think an extra flag for that would make sense.

This doesn't make sense IMHO. If you provide JSON output, the output should be valid JSON and nothing else (p.e. kubectl -o yaml). This is not the usual way to provide this kind of feature. This breaks tools like jq which normally would be piped without the need to redirect stderr to /dev/null...

I can only speak for myself but this is the first application where I am forced to do it this way.

from cli.

phm07 avatar phm07 commented on September 22, 2024 1

This is intentional. Because the progress is printed in stderr, you can handle it separately. For example, this is how you would hide it entirely:
server request-console -o json 2>/dev/null
I don't think an extra flag for that would make sense.

This doesn't make sense IMHO. If you provide JSON output, the output should be valid JSON and nothing else (p.e. kubectl -o yaml). This is not the usual way to provide this kind of feature. This breaks tools like jq which normally would be piped without the need to redirect stderr to /dev/null...

I can only speak for myself but this is the first application where I am forced to do it this way.

It doesn't break jq. A pipe only forwards stdout by default, we considered that when we made the change.
Only problem I see so far is that you can't distinguish errors (which are printed to stderr too) from the progress bar output. So I think a --quiet (opt-out) or --progress (opt-in) could be useful indeed.

from cli.

itg-dave avatar itg-dave commented on September 22, 2024 1

It doesn't break jq. A pipe only forwards stdout by default, we considered that when we made the change. Only problem I see so far is that you can't distinguish errors (which are printed to stderr too) from the progress bar output. So I think a --quiet (opt-out) or --progress (opt-in) could be useful indeed.

Thanks for the clarification, i corrected my comment above. And thank you for considering this!

from cli.

phm07 avatar phm07 commented on September 22, 2024

This is intentional. Because the progress is printed to stderr, you can handle it separately. For example, this is how you would hide it entirely:

server request-console <server> -o json 2>/dev/null

I don't think an extra flag for that would make sense.

from cli.

LarsKumbier avatar LarsKumbier commented on September 22, 2024

This is intentional. Because the progress is printed in stderr, you can handle it separately. For example, this is how you would hide it entirely:

That's how I solved it for now, but I also never saw a solution like that.
I'd rather see a commandline flag instead.

from cli.

itg-dave avatar itg-dave commented on September 22, 2024

This is intentional. Because the progress is printed in stderr, you can handle it separately. For example, this is how you would hide it entirely:
server request-console -o json 2>/dev/null
I don't think an extra flag for that would make sense.

This doesn't make sense IMHO. If you provide JSON output, the output should be valid JSON and nothing else (p.e. kubectl -o yaml). This is not the usual way to provide this kind of feature. This breaks tools like jq which normally would be piped without the need to redirect stderr to /dev/null...

I can only speak for myself but this is the first application where I am forced to do it this way.

Another solution could be a quiet-flag (like curl -s). If this is passed, we can ensure, that script-friendly output is generated.

from cli.

LarsKumbier avatar LarsKumbier commented on September 22, 2024

You're completely right; turns out it was a completely separate issue. Should I leave the issue open as a feature request nonetheless?

from cli.

Srakbi avatar Srakbi commented on September 22, 2024

hcloud server request-console <server> -o json now outputs not only json, but also the progress on the STDERR channel:

$ hcloud server request-console <server> -o json
1.1s [===================================] 100.00%
{
  "wss_url": "wss://web-console.hetzner.cloud/?server_id=<server_id>\u0026token=<token>",
  "password": "<password>"
}

If json is requested, only json should be in the output. Maybe add an optional --progress, if that feature should still be present.

Issue was introduced with hcloud v1.41.
last known good is hcloud v1.40.

Close _ # 644

from cli.

Srakbi avatar Srakbi commented on September 22, 2024

I'm sorry 😞

from cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.