mirror of
https://github.com/sstent/FitTrack_GarminSync.git
synced 2026-01-27 01:22:03 +00:00
feat: Add --debug option to CLI for verbose output
This commit introduces a global option to the GarminSync CLI, providing verbose logging and diagnostic information for troubleshooting. Key changes include: - Implemented a to manage and propagate the debug flag across CLI commands. - Refactored in to accept and utilize the debug flag, enabling detailed logging of HTTP requests and responses. - Updated CLI commands (, ) to access the from the . - Resolved circular import by extracting into a dedicated module. - Configured for Poetry-based dependency management. - Addressed various type hinting issues and linting warnings across the CLI codebase to maintain code quality.
This commit is contained in:
10
cli/src/context.py
Normal file
10
cli/src/context.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import click
|
||||
from typing import Optional
|
||||
from .api.client import ApiClient # Import ApiClient
|
||||
|
||||
class CliContext:
|
||||
def __init__(self):
|
||||
self.debug = False
|
||||
self.api_client: Optional[ApiClient] = None # Store ApiClient instance
|
||||
|
||||
pass_cli_context = click.make_pass_decorator(CliContext, ensure=True)
|
||||
Reference in New Issue
Block a user