Added some error handling for invalid commandline options
This commit is contained in:
parent
b60e8edf7a
commit
7fc87e6be9
1 changed files with 9 additions and 4 deletions
|
@ -48,8 +48,11 @@ def main(argv):
|
|||
# CLI Argument Processing
|
||||
try:
|
||||
opts, args = getopt.getopt(argv, "i:o:m:v:a:t:hf", ["input=", "output=", "mpopts=", "abitrate=", "vbitrate=", "threads=", "help", "force-overwrite"])
|
||||
except getopt.GetoptError as err:
|
||||
printi(str(err))
|
||||
except:
|
||||
usage()
|
||||
|
||||
if (len(args) != 0):
|
||||
print("Error: Unsupported Arguments found!")
|
||||
usage()
|
||||
|
||||
input = None
|
||||
|
@ -256,8 +259,10 @@ def cleanup():
|
|||
# Cleanup
|
||||
try:
|
||||
if (mda != None):
|
||||
if (mda.pid() != None):
|
||||
os.kill(mda.pid())
|
||||
if (mdv != None):
|
||||
if (mda.pid() != None):
|
||||
os.kill(mdv.pid())
|
||||
finally:
|
||||
if (afifo != None):
|
||||
|
|
Loading…
Reference in a new issue