Giter Club home page Giter Club logo

Comments (4)

muvaf avatar muvaf commented on May 27, 2024 1

it's not that you shouldn't print anything when not a TTY, just that things like confirmation and things like "do this next" do not make sense in the context of a script

Got it, yeah I was thinking about reporting back to user like universal-crossplane v1.2.1-up.3 is installed!. Agree that the long ones with instructions can be saved for TTY.

from up.

hasheddan avatar hasheddan commented on May 27, 2024

Very much agree that we can improve messaging for a number of commands, both on success and failure. I am working on a design for a framework for doing this so that we are consistent across all commands. Things that I think are important to support:

  • Do not print confirmation (or any otherwise extraneous text) when not in a TTY (similar to how we refuse to prompt here)
  • Add global flag for silencing all output
  • Add global flag for forcing machine readable output -- for instance, I think it would be awesome if every command supported --json, making it such that the output of any command could be easily piped to utilities like jq for consumption

from up.

muvaf avatar muvaf commented on May 27, 2024

Add global flag for forcing machine readable output

Yes, I love kubectl's -o flag.

Do not print confirmation (or any otherwise extraneous text) when not in a TTY

Is there a particular reason to not print out of TTY? I think most tools I've used print no matter you're in TTY or not. Not printing usually exists in tools whose job is to print something, like cat or kubectl logs.

from up.

hasheddan avatar hasheddan commented on May 27, 2024

@muvaf it's not that you shouldn't print anything when not a TTY, just that things like confirmation and things like "do this next" do not make sense in the context of a script because:

  1. Errors should be checked by exit code
  2. If the command is in a script, there is no need to tell what to do next

Basically, if not a TTY, verbosity should be reduced. As an example, with up cloud login we might print something like "See what control planes exist in this account with up cloud xp list or attach you UXP cluster with `up cloud xp attach". These commands would be helpful to a user in an interactive setting, but would be noise in the context of a CI pipeline or similar. Here is some good guidance on when to print what.

from up.

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.