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
|
# CLI Argument Processing
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(argv, "i:o:m:v:a:t:hf", ["input=", "output=", "mpopts=", "abitrate=", "vbitrate=", "threads=", "help", "force-overwrite"])
|
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:
|
except:
|
||||||
printi(str(err))
|
usage()
|
||||||
|
|
||||||
|
if (len(args) != 0):
|
||||||
|
print("Error: Unsupported Arguments found!")
|
||||||
usage()
|
usage()
|
||||||
|
|
||||||
input = None
|
input = None
|
||||||
|
@ -256,9 +259,11 @@ def cleanup():
|
||||||
# Cleanup
|
# Cleanup
|
||||||
try:
|
try:
|
||||||
if (mda != None):
|
if (mda != None):
|
||||||
os.kill(mda.pid())
|
if (mda.pid() != None):
|
||||||
|
os.kill(mda.pid())
|
||||||
if (mdv != None):
|
if (mdv != None):
|
||||||
os.kill(mdv.pid())
|
if (mda.pid() != None):
|
||||||
|
os.kill(mdv.pid())
|
||||||
finally:
|
finally:
|
||||||
if (afifo != None):
|
if (afifo != None):
|
||||||
os.remove(afifo)
|
os.remove(afifo)
|
||||||
|
|
Loading…
Reference in a new issue