Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a -q/quiet option #182

Open
Tracked by #1587
duglin opened this issue Jun 12, 2019 · 17 comments
Open
Tracked by #1587

Add a -q/quiet option #182

duglin opened this issue Jun 12, 2019 · 17 comments
Assignees
Labels
kind/feature New feature or request triage/accepted Issues which should be fixed (post-triage)

Comments

@duglin
Copy link
Contributor

duglin commented Jun 12, 2019

While the current model of printing a "success" message can be useful for newbies, I actually think it kind of odd since IMO most Linux commands tend to be silent unless there are error - or there's really important info you need to get your next job done. But things like creating a service really shouldn't need any output when things work. I tend to think that messages like this are handy the first couple of times you run a command (as I said, for newbies), then after that it gets annoying because I've been conditioned to learn that "no output means things worked" and anything else is something I need to look at because odds are it means there are error messages. Remember, most people don't do echo $? after they run a command to see the exit code, so asking them to scan the output for an error message is (IMO) asking a lot when people are flying thru their commands to get a job done.

However, I'm not going to suggest we drop those messages (yet, even though I do think it would be better to do so :-) ). For now, I'd be ok with just adding a -q/quiet type of flag so that I can hide this verbosity. An env var would be nice too so I can set it once and forget about it.

What do people think?

@rhuss
Copy link
Contributor

rhuss commented Jun 12, 2019

I'm happy to support a quiet mode, it's a perfectly valid use case. However, I think there is valuable information which can be printed out, too, which goes beyond a pure success:

So I'm all for supporting both: Using a human-friendly message for interactive CLI usage and a silent usage for script (but even then it might be useful e.g. when running in a CI environment).

@duglin
Copy link
Contributor Author

duglin commented Jun 12, 2019

I do agree that showing the URL is more useful than "it worked!" :-) but even then, given a choice I'd still prefer to have no output because the URL should be a well-defined/calculated value and have people ask for the URL via a flag if they want it. But that's just me. A -q for now is ok with me.

@maximilien
Copy link
Contributor

maximilien commented Jun 12, 2019

👍 quiet option makes sense.

@rhuss
Copy link
Contributor

rhuss commented Jun 14, 2019

/assign rhuss

@duglin
Copy link
Contributor Author

duglin commented Sep 10, 2019

Per our call today, some additional thoughts and things I've seen. Using tar as the example linux app:

$ tar -cf a.tar *   # will show no output because it worked

$ tar -vcf a.tar *   # will show list of files processed due to -v option, these go to stdout
file1
file2

And this makes sense to me because 1) there's no error, so nothing on stderr, and 2) the user asked for additional output, so it goes to stdout.

Now, there might be other flags (like --debug type of flags) that generate output and I do actually think it makes sense for that to go to stderr so they don't disrupt your normal workflow. I think "warnings" fit into that category but I'm not sure, I'm having trouble finding a good standard linux cmd that printing warnings.

@rhuss
Copy link
Contributor

rhuss commented Sep 11, 2019

I still believe that the default assumption should be that kn is used as an interactive tool, so having by default success and error messages for e.g. kn service create is much more user-friendly than having only an error code to detect whether an operation is successful or not.

So I still in strong favour to add -q for the scripting use case (like eg. for grep).

Having a similar level of verbosity like other tools as docker and kubectl that play in the same arena also helps.

Another option would be to detect whether running with a tty or not and then decide on the level of verbosity, but that has the 'magic switch' disadvantage.

@duglin
Copy link
Contributor Author

duglin commented Sep 11, 2019

only an error code to detect whether an operation is successful or not.

I'm not suggesting that. There should always be error messages. But in the case of the tool doing exactly what you asked, I don't see the point in saying "Hey, I did it!". Now, showing info, like the URL to which the service was deployed to is different because that's info you need to take the next step in your process. If look at standard unix-y tools like grep, tar, cc .... they will all just exit w/o "successful" messages. No news is good news :-)

re: detecting tty... I tend to be against that because then you get different output based on how something is run and I find that really hard to manage and deal with. E.g. I run something from cmd line and it works a certain way. I then run it via a script and I get totally different output and now need to go figure out which flags to set to get the same output. curl does this and I find it very annoying.

coryrc pushed a commit to coryrc/client that referenced this issue May 14, 2020
Such names are invalid in GCP, and they can be generated in a local environment with a prefix that has the right length (e.g., "build-pipeline").
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 15, 2020
@duglin
Copy link
Contributor Author

duglin commented Oct 15, 2020

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 15, 2020
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 14, 2021
@rhuss
Copy link
Contributor

rhuss commented Jan 14, 2021

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 14, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 15, 2021
@rhuss
Copy link
Contributor

rhuss commented Apr 15, 2021

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 15, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 15, 2021
@duglin
Copy link
Contributor Author

duglin commented Jul 15, 2021

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 15, 2021
@github-actions
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 14, 2021
@rhuss
Copy link
Contributor

rhuss commented Oct 20, 2021

/remove-lifecycle stale

@knative-prow-robot knative-prow-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 20, 2021
@rhuss rhuss added the triage/accepted Issues which should be fixed (post-triage) label Nov 16, 2021
@rhuss rhuss mentioned this issue Jan 27, 2022
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request triage/accepted Issues which should be fixed (post-triage)
Projects
None yet
Development

No branches or pull requests

5 participants