From 4015db5bcf4753455a49818f4a99cee886c13cd9 Mon Sep 17 00:00:00 2001 From: k4yt3x Date: Sat, 23 May 2020 08:59:57 -0400 Subject: [PATCH] CLI 4.0.1: require input and output to be specified if help is not specified --- src/video2x.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/video2x.py b/src/video2x.py index c96943b..9e64797 100755 --- a/src/video2x.py +++ b/src/video2x.py @@ -13,7 +13,7 @@ __ __ _ _ ___ __ __ Name: Video2X Controller Creator: K4YT3X Date Created: Feb 24, 2018 -Last Modified: May 15, 2020 +Last Modified: May 23, 2020 Editor: BrianPetkovsek Last Modified: June 17, 2019 @@ -80,7 +80,7 @@ language.install() _ = language.gettext -CLI_VERSION = '4.0.0' +CLI_VERSION = '4.0.1' LEGAL_INFO = _('''Video2X CLI Version: {} Upscaler Version: {} @@ -107,8 +107,15 @@ def parse_arguments(): # video options video2x_options = parser.add_argument_group(_('Video2X Options')) video2x_options.add_argument('-h', '--help', action='help', help=_('show this help message and exit')) - video2x_options.add_argument('-i', '--input', type=pathlib.Path, help=_('source video file/directory')) - video2x_options.add_argument('-o', '--output', type=pathlib.Path, help=_('output video file/directory')) + + # if help is in arguments list + # do not require input and output path to be specified + require_input_output = True + if '-h' in sys.argv or '--help' in sys.argv: + require_input_output = False + video2x_options.add_argument('-i', '--input', type=pathlib.Path, help=_('source video file/directory'), required=require_input_output) + video2x_options.add_argument('-o', '--output', type=pathlib.Path, help=_('output video file/directory'), required=require_input_output) + video2x_options.add_argument('-c', '--config', type=pathlib.Path, help=_('video2x config file path'), action='store', default=pathlib.Path(__file__).parent.absolute() / 'video2x.yaml') video2x_options.add_argument('-v', '--version', help=_('display version, lawful information and exit'), action='store_true')