mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Implement --version flag
This commit is contained in:
@ -6,8 +6,14 @@ from pathlib import Path
|
||||
from .config import Config, ConfigDumpException, ConfigLoadException
|
||||
from .output_dir import OnConflict, Redownload
|
||||
from .pferd import Pferd
|
||||
from .version import NAME, VERSION
|
||||
|
||||
GENERAL_PARSER = argparse.ArgumentParser(add_help=False)
|
||||
GENERAL_PARSER.add_argument(
|
||||
"--version",
|
||||
action="store_true",
|
||||
help="print version and exit"
|
||||
)
|
||||
GENERAL_PARSER.add_argument(
|
||||
"--config", "-c",
|
||||
type=Path,
|
||||
@ -211,6 +217,10 @@ def prune_crawlers(
|
||||
def main() -> None:
|
||||
args = PARSER.parse_args()
|
||||
|
||||
if args.version:
|
||||
print(f"{NAME} {VERSION}")
|
||||
exit()
|
||||
|
||||
try:
|
||||
config = Config(load_parser(args))
|
||||
except ConfigLoadException:
|
||||
|
Reference in New Issue
Block a user