click_config
A configuration option for click.
Classes¶
ConfigOption
¶
ConfigOption(param_decls: Optional[StrSequence] = None, show_default: Optional[BoolOrStr] = None, allow_from_autoenv: bool = True, help: Optional[str] = None, show_envvar: bool = False, **attrs)
Functions:¶
config_option
¶
config_option(*param_decls: str, cls: Optional[Type[ConfigOption]] = None, **attrs: Any) -> Callable[[FC], FC]
Attaches a ConfigOption to the command.
All positional arguments are passed as parameter declarations to ConfigOption.
All keyword arguments are forwarded unchanged (except cls). This is equivalent to creating a
ConfigOption instance manually and attaching it to the Command.params list.
For the default option class, refer to ConfigOption and Parameter for descriptions of parameters.
| PARAMETER | DESCRIPTION |
|---|---|
*param_decls
|
Passed as positional arguments to the constructor of
TYPE:
|
cls
|
the option class to instantiate. This defaults to
TYPE:
|
**attrs
|
Passed as keyword arguments to the constructor of
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Callable[[FC], FC]
|
A decorated function. |
download_url
¶
download_url(url: str) -> Path
Download the contents of a URL.
| PARAMETER | DESCRIPTION |
|---|---|
url
|
The URL to download
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
The Path to the downloaded file. |
| RAISES | DESCRIPTION |
|---|---|
BadInputError
|
if there is a problem downloading the URL |
get_file_name_from_url
¶
get_file_name_from_url(url: str) -> str
resolve_conf_location
¶
resolve_conf_location(url_or_path: str) -> Path
Resolve a URL or path.
The path is considered a URL if it is parseable as such and starts with http:// or https://.
| PARAMETER | DESCRIPTION |
|---|---|
url_or_path
|
The URL or path to resolve.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Path
|
The contents of the location. |
| RAISES | DESCRIPTION |
|---|---|
BumpVersionError
|
if the file does not exist. |