-
-
Notifications
You must be signed in to change notification settings - Fork 684
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
🐛 Fix context_settings
for a Typer app with a single command
#210
Conversation
Codecov Report
@@ Coverage Diff @@
## master #210 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 252 252
Lines 5287 5296 +9
=========================================
+ Hits 5287 5296 +9
Continue to review full report at Codecov.
|
@daddycocoaman great work on your PR, maybe your predicate in line 241:
could be:
That way if a user (for some odd reason) sets the context settings explicitly to |
That makes perfect sense. When I first tried using DefaultPlaceholder, I must have messed up the conditional because the local test failed. I'll make that change. |
@malthunayan It turns out that
Since the value is already set to |
Hey, @daddycocoaman, |
I was just running into this issue and I'm glad this PR is here. @tiangolo do you plan on pulling this in? |
📝 Docs preview for commit e8f947d at: https://62c07354f22cef5e2cb4216f--typertiangolo.netlify.app |
context_settings
for a Typer app with a single command
Awesome, thanks a lot for your contribution @daddycocoaman! 🍰 And thanks for the discussion here everyone! 👏 🙇 |
Addresses #208
When the design choice is to create an
typer.Typer()
object withcontext_settings
, that context should be passed even when only a single command is registered. This is already handled when there are more than two commands since a Group is created in that scenario but should also exist for single commands.