-
Notifications
You must be signed in to change notification settings - Fork 16
curl: override any "-w" options that might exist #11
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
base: main
Are you sure you want to change the base?
Conversation
1180934
to
2280dbb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using -w
would conflict with an existing curl option I believe:
-w, --write-out <format>
Make curl display information on stdout after a completed transfer. The format is a string that may contain plain text mixed with any number of variables. The format can be specified as a literal "string", or you can have curl read the format from a file with "@filename"
and to tell curl to read the format from stdin you write "@-".
...
Do you have another preferred argument?
Alternatively we could use an environment variable to alter the behavior.
Sorry that's the goal - I have "-w \n" in my .curlrc because it makes most curl requests format better when printed to stdout. But it breaks pprof files downloaded with curl which is one of the main things you'd be downloading with kubectl-curl. I guess I could check if stdout is a TTY or not, and only append the "-w" argument if it's not? |
🤔 I believe it should work already then? Maybe it didn't because of #10 ? Have you tried with the latest release? |
When you say "it" what do you mean? On master, kubectl-curl reads the contents of .curlrc ("-w \n") and appends a newline, which I don't want it to do, since it breaks pprof file parsing. On this branch, kubectl-curl reads the contents of .curlrc but they are overridden by the argument passed directly here. |
What I mean is passing of the I think reading of the |
Better to use the `-o`, `--output` flag than redirect stdout because that will omit any `-w` flags that you may have set in e.g. `.curlrc`.
2280dbb
to
14a2af0
Compare
See the code comment for an explanation.