25 lines
639 B
Python
25 lines
639 B
Python
import argparse
|
|
from pathlib import Path
|
|
|
|
def parse_arguments():
|
|
parser = argparse.ArgumentParser(
|
|
description="Convert an image or folder of images into a PDF file."
|
|
)
|
|
parser.add_argument(
|
|
"input_path",
|
|
type=str,
|
|
help="Path to an image file or a folder containing images.",
|
|
)
|
|
parser.add_argument(
|
|
"-o", "--output",
|
|
type=str,
|
|
required=True,
|
|
help="Output PDF file path.",
|
|
)
|
|
parser.add_argument(
|
|
"--overwrite",
|
|
action="store_true",
|
|
help="Overwrite the output file if it already exists.",
|
|
)
|
|
return parser.parse_args()
|