From 8ff995a29fd3188f69ba7bc5f1391379e4996b44 Mon Sep 17 00:00:00 2001 From: Fabrice Quenneville Date: Sat, 8 Feb 2025 13:55:14 -0500 Subject: [PATCH] feat: Add shorthand parameters to video_manage_audio.py and video_manage_subtitles.py - Added shorthand options for common arguments: - `-t` for --track - `-f` for --file - `-d` for --dir - Simplified command-line usage for managing audio and subtitle tracks in video files. --- scripts/video_manage_audio.py | 7 +++++-- scripts/video_manage_subtitles.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/video_manage_audio.py b/scripts/video_manage_audio.py index 66e8b9a..a0ad3a3 100755 --- a/scripts/video_manage_audio.py +++ b/scripts/video_manage_audio.py @@ -93,14 +93,17 @@ def main(): help='Command to run') # Add other arguments with both short and long options, including defaults - parser.add_argument("--track", + parser.add_argument("-t", + "--track", type=int, default=0, help="Audio track index (default is 0).") - parser.add_argument("--file", + parser.add_argument("-f", + "--file", type=str, help="Path to a specific video file.") parser.add_argument( + "-d", "--dir", type=str, default=os.getcwd(), diff --git a/scripts/video_manage_subtitles.py b/scripts/video_manage_subtitles.py index 6dbfbb4..34a6837 100755 --- a/scripts/video_manage_subtitles.py +++ b/scripts/video_manage_subtitles.py @@ -91,7 +91,7 @@ def main(): # Create argument parser parser = argparse.ArgumentParser( - description="Manage subtitles tracks in video files.") + description="Manage subtitle tracks in video files.") # Define command line arguments # Add a positional argument for the command @@ -101,16 +101,19 @@ def main(): # Add other arguments with both short and long options, including defaults parser.add_argument( + "-t", "--track", type=int, default=0, help= "Subtitle track index (default is 0). Use 'none' to remove all subtitles." ) - parser.add_argument("--file", + parser.add_argument("-f", + "--file", type=str, help="Path to a specific video file.") parser.add_argument( + "-d", "--dir", type=str, default=os.getcwd(),