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
Remove "Getting OAuth token...\nOK" from cf oauth-token command #752
Comments
We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/113018007. |
Hi @youngm, I assume you're aware of
I'm concerned what a mess we'd get if we singled out certain commands and limit their output, or add a flag, and addressing this for all commands with a global flag would take a long time to design and implement. On the other hand, thinking of the purpose of this command, and comparing it with Regards, |
@dkoper Yes, I"m aware of cf curl I'm wanting to grab the bearer token for other purposes and just chose curl as an example. Yes both lines are a problem. Yes, tail will work but since this will go into scripts that my users will be making I think it would be simpler and better for them if the scripts included as little odd hacks like that as possible. I think it would be best if I could run the command and know that I will always only get the bearer like I see your concern about having some commands seemingly randomly output preludes like that and some commands not. However, I think this can be rationalized with a general rule. Something to the effect that if a command outputs data that is not really human readable/consumable the command should not include status output that is human consumable/readable. What do you think? Perhaps we missed our chance to do things right with oauth-token? |
I like the rule. Please let me know if you find any similar cases with other commands.
Thanks! |
@dkoper Thanks. If I get to it first I'll submit a PR. |
We got to it first, check it out in our edge binaries. |
Works great! Thanks @dkoper |
FYI, this has been included in cf CLI v6.16.0. Regards, |
The oauth-token command is awesome. However, I cannot use it for inline command executions because it outputs some non token content which means I cannot use it inline with something like curl:
curl -H "Authorization: $(cf oauth-token)" https://api.cf.com/v2/apps
I'd be happy to submit a PR that either removes the "OK" output or add a parameter that when specified removes the "OK" output. Which would you prefer?
Mike
The text was updated successfully, but these errors were encountered: