fix: skip first line bug, adjust argument descriptions
This commit is contained in:
@@ -16,8 +16,22 @@ def parse_args() -> argparse.Namespace:
|
||||
epilog="If you have any questions let me know at parker@parkerbritt.com"
|
||||
)
|
||||
|
||||
parser.add_argument("--shows-directory", default="/shows", help="Specifies the directory shows are contained within.")
|
||||
parser.add_argument("--paths-file", help="Specifies a file containing show paths to inspect and validate.")
|
||||
parser.add_argument(
|
||||
"--shows-directory",
|
||||
default="/shows",
|
||||
help=(
|
||||
"Root directory containing all show projects. "
|
||||
"Defaults to '/shows'. "
|
||||
"Use this to specify a different base path if your projects are stored elsewhere, for example in testing environments."
|
||||
)
|
||||
)
|
||||
parser.add_argument(
|
||||
"--paths-file",
|
||||
help=(
|
||||
"Path to a text file listing the directories "
|
||||
"to inspect and validate. Each line in the file should contain one directory path."
|
||||
)
|
||||
)
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
@@ -49,12 +49,12 @@ def validate_paths_from_file(parsed_args: argparse.Namespace, file: str) -> None
|
||||
with open(file, "r") as f:
|
||||
line = f.readline()
|
||||
while(line):
|
||||
line = f.readline()
|
||||
|
||||
if(should_skip_line(line)):
|
||||
continue
|
||||
# clean line
|
||||
path = line.strip()
|
||||
line = f.readline()
|
||||
|
||||
if(should_skip_line(path)):
|
||||
continue
|
||||
|
||||
# validate path
|
||||
if(not validate_path(parsed_args, path)):
|
||||
|
||||
Reference in New Issue
Block a user