Skip to content

Commit

Permalink
fix: change filepath options type to pathlib.Path (#1506)
Browse files Browse the repository at this point in the history
  • Loading branch information
jooola committed Jan 12, 2022
1 parent db8dd87 commit d986302
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit d986302

Please sign in to comment.