-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dune-sync-57
- Loading branch information
Showing
18 changed files
with
675 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"""Command line argument parser for dune-sync application.""" | ||
|
||
from __future__ import annotations | ||
|
||
import argparse | ||
from dataclasses import dataclass | ||
from pathlib import Path | ||
|
||
from src import root_path | ||
|
||
|
||
@dataclass | ||
class Args: | ||
"""Command line argument parser for dune-sync application.""" | ||
|
||
config: Path | ||
jobs: list[str] | None | ||
|
||
@classmethod | ||
def from_command_line(cls) -> Args: | ||
"""Create Args instance from command line arguments.""" | ||
parser = argparse.ArgumentParser( | ||
description="Dune Sync - Data synchronization tool" | ||
) | ||
parser.add_argument( | ||
"--config", | ||
type=Path, | ||
default=root_path.parent / "config.yaml", | ||
help="Path to configuration file (default: config.yaml)", | ||
) | ||
parser.add_argument( | ||
"--jobs", | ||
type=str, | ||
nargs="*", # accepts zero or more arguments | ||
default=None, | ||
help="Names of specific jobs to run (default: run all jobs)", | ||
) | ||
args = parser.parse_args() | ||
return cls( | ||
config=args.config, | ||
jobs=args.jobs if args.jobs else None, # Convert empty list to None | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.