-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Fix help output for "exec --no-tty" option #13314
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
Conversation
|
For legal reasons, contributor MUST sign-off commits before we can merge. Please amend your commit with |
f0169d2 to
14835bc
Compare
|
Nice catch by the way, this surprising feature in pflags we probably could use to improve help messages in a few places |
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.
LGTM
|
@tonyo You need to run |
Signed-off-by: Anton Ovchinnikov <[email protected]>
Head branch was pushed to by a user without write access
14835bc to
57ad5f2
Compare
Done 👍 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [docker/compose](https://github.com/docker/compose) | patch | `v2.40.2` -> `v2.40.3` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>docker/compose (docker/compose)</summary> ### [`v2.40.3`](https://github.com/docker/compose/releases/tag/v2.40.3) [Compare Source](docker/compose@v2.40.2...v2.40.3) #### What's Changed ##### 🐛 Fixes - Fix OCI compose override support by [@​ndeloof](https://github.com/ndeloof) [#​13311](docker/compose#13311) - Fix help output for "exec --no-tty" option by [@​tonyo](https://github.com/tonyo) [#​13314](docker/compose#13314) - Prompt default implementation to prevent a panic by [@​ndeloof](https://github.com/ndeloof) [#​13317](docker/compose#13317) - Run hooks on restart by [@​ndeloof](https://github.com/ndeloof) [#​13321](docker/compose#13321) - Fix(run): Ensure images exist only for the target service in run command by [@​idsulik](https://github.com/idsulik) [#​13325](docker/compose#13325) - Fix(git): Fix path traversal vulnerability in git remote loader by [@​idsulik](https://github.com/idsulik) [#​13331](docker/compose#13331) ##### 🔧 Internal - Test to check writeComposeFile detects invalid OCI artifact by [@​ndeloof](https://github.com/ndeloof) [#​13309](docker/compose#13309) - Code Cleanup by [@​ndeloof](https://github.com/ndeloof) [#​13315](docker/compose#13315) ##### ⚙️ Dependencies - Bump compose-go to version v2.9.1 by [@​glours](https://github.com/glours) [#​13332](docker/compose#13332) **Full Changelog**: <docker/compose@v2.40.2...v2.40.3> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNjkuMSIsInVwZGF0ZWRJblZlciI6IjQxLjE2OS4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
What I did
Replaced backticks with single quotes in the help output of
docker compose execfor the--no-TTYoption.Currently the output of
docker compose exec --helplooks like this:Note the
-Tline:That "docker compose exec" part after
--no-TTYis most likely unintentional; it's there because Cobra (or more specifically, pflag) found the backticks and extracted the wrapped value via UnquoteUsage function.This is a not-so-well documented behavior, see e.g. this and this.
After the change the output looks as expected:
Note
The
By default 'docker compose exec' allocates a TTY.part of the output is not entirely correct, given that the default value of the flag is!dockerCli.Out().IsTerminal()(source). It'd be more like, "By default 'docker compose exec' allocates a TTY when the output is a terminal."Let me know if that sounds better and I'll update it in a separate PR.
(not mandatory) A picture of a cute animal, if possible in relation to what you did