| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Allow option values that start with an option prefix to
complete rather than treating them like new options.
Don't treat count options as needing a value to complete.
|
| |
|
|
|
|
| |
Co-authored-by: David Lord <davidism@gmail.com>
|
| |
|
|
|
|
|
|
| |
This makes it possible to open a resource, make it available to
callbacks and subcommands, then ensure the resource is cleaned up when
the group ends and the context goes out of scope.
|
| |
|
|\ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
Changing Context._sources_by_paramname to Context._source_by_paramname. Renaming ParameterSource.validate clz arg to cls and removing doc for that argument in the docstring
|
| |
| |
| |
| | |
'option'. Removed emphasis of the word source in Context.get_parameter_source. Changed ParameterSource.VALUE to a set instead of list. Fixed bugs in ParameterSource.validate and added unit test for it. Changed Context.get_parameter_source to return a KeyError when an invalid parameter name is specified.
|
| |
| |
| |
| | |
a source and added unit tests for it.
|
|/
|
|
| |
parameter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
= Refactor BaseCommand to simplify Exit handling
BaseCommand.main() will get the return value from `self.invoke` and
pass it to `ctx.exit()`, so that commands which `return 1` will
`ctx.exit(1)`
This is not a behavioral change -- `ctx.exit()` already does this.
Do not reraise Exit exceptions when invoked non-standalone. Instead,
return their exit codes as the result of `BaseCommand.main`. So, a
command which explicitly invokes `ctx.exit(0)` in its execution will
effectively `return 0` instead of raising a specialized exception.
= Make Exit its own RuntimeError subtype, don't pollute stdio on exit
Exit exceptions should not be a subtype of ClickException with the
output pretty-printing (`show()`) which happens when they are raised in
non-standalone mode. That would make `ctx.exit(...)` needlessly pollute
stderr. This would have downstream impact on everyone using context exit
calls, and generally be a Bad Thing (tm).
Instead, like Abort, Exit is a subclass of RuntimeError with very little
"meat on its bones". It's an exception containing a single integer (exit
code) which is then interpreted in that way in BaseCommand.main
closes #533
closes #667
|
| |
|
|
|
|
|
|
| |
This exception is caught in Command.main where we turn this into either
an exception or a system exit. This allows context.exit to work when
standalone_mode=False.
|
|
|
|
|
| |
This adds a simple test case which ensures that `make_pass_decorator`
doesn't consume arguments if it's called out of order.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rebased version of #410 for bugfix release
When a function is decorated with @click.pass_obj, it should receive the
ctx.obj content as first argument. Instead, it actually receives the ctx.obj
content *and* ctx itself. This is an undocumented behavior, and it was
introduced in click 5.0 with commit 695ca34.
This commit fixes the decorator in order to restore the documented, pre-5.0
behavior, so the decorated function will receive only ctx.obj.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This allows click users to access the context object from anywhere
within the current thread. The access to this object is properly
scoped as before.
|
| |
|
|
|