Skip to content
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(shared): change filepath options type to pathlib.Path #1506

Merged
merged 1 commit into from Jan 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions shared/libretime_shared/cli.py
@@ -1,3 +1,4 @@
from pathlib import Path
from typing import Callable

import click
Expand Down Expand Up @@ -27,7 +28,7 @@ def cli_logging_options(func: Callable) -> Callable:
"--log-filepath",
"log_filepath",
envvar=f"{DEFAULT_ENV_PREFIX}_LOG_FILEPATH",
type=click.Path(),
type=click.Path(path_type=Path),
help="Path to the logging file.",
default=None,
)(func)
Expand All @@ -40,15 +41,15 @@ def cli_config_options(func: Callable) -> Callable:
Decorator function to add config file options to a click application.

This decorator add the following arguments:
- config_filepath: Path
- config_filepath: Optional[Path]
"""

func = click.option(
"--c",
"--config",
"config_filepath",
envvar=f"{DEFAULT_ENV_PREFIX}_CONFIG_FILEPATH",
type=click.Path(),
type=click.Path(path_type=Path),
help="Path to the config file.",
default=None,
)(func)
Expand Down