Skip to content

Commit 062880a

Browse files
committed
chore: update tasks
1 parent 2fe886f commit 062880a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
frames/*
2-
src/__pycache__
2+
src/__pycache__
3+
build/*
4+
main.spec
5+
dist/*

src/Launcher.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ def check_dir():
99

1010
def init_parser() :
1111
parser = argparse.ArgumentParser(description="Extract frames from a video.")
12-
parser.add_argument('--path', type=str, required=True, help="Path to the video file.")
13-
parser.add_argument('--frame', type=int, help="Frame number to extract.")
14-
parser.add_argument('--min', type=int, help="Minimum frame number to extract.")
15-
parser.add_argument('--max', type=int, help="Maximum frame number to extract.")
12+
parser.add_argument('--path', '-p', type=str, required=True, help="Path to the video file.")
13+
parser.add_argument('--frame', '-f', type=int, help="Frame number to extract.")
14+
parser.add_argument('--min', type=int, help="(Range) Minimum frame number to extract.")
15+
parser.add_argument('--max', type=int, help="(Range) Maximum frame number to extract.")
16+
parser.add_argument('--version', '-v', action="version", version="%(prog)s v0.1.0 (Beta version)", help="Print program version and exit")
1617

1718
args = parser.parse_args()
1819

@@ -22,6 +23,8 @@ def init_parser() :
2223
frame.extract_single_frame(args.frame)
2324
elif args.min is not None and args.max is not None:
2425
frame.extract_frames(args.min, args.max)
26+
elif (args.min is not None and args.max is None) or (args.min is None and args.max is not None):
27+
print("Use both args '--min' and '--max' to specified range frames.")
2528
else:
2629
print("No frame or range specified. Extracting all frames from the video.")
2730
frame.extract_frames()

0 commit comments

Comments
 (0)