CC-2659: Print help for airtime-import when a copy or move switch is
not provided - fixed
This commit is contained in:
parent
b2db168a10
commit
33df22d2ec
|
@ -5,7 +5,8 @@ virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|||
|
||||
invokePwd=$PWD
|
||||
|
||||
airtime_import_path="/usr/lib/airtime/utils/airtime-import/"
|
||||
#airtime_import_path="/usr/lib/airtime/utils/airtime-import/"
|
||||
airtime_import_path="/home/james/src/airtime/utils/airtime-import/"
|
||||
airtime_import_script="airtime-import.py"
|
||||
|
||||
api_client_path="/usr/lib/airtime/"
|
||||
|
|
|
@ -120,6 +120,8 @@ There are two ways to import audio files into Airtime:
|
|||
|
||||
def CopyAction(option, opt, value, parser):
|
||||
errorIfMultipleOption(parser.rargs)
|
||||
if(len(parser.rargs) == 0 ):
|
||||
raise OptionValueError("No argument found. This option requires at least one argument.")
|
||||
stor = helper_get_stor_dir()
|
||||
if(stor is None):
|
||||
exit("Unable to connect to the Airtime server.")
|
||||
|
@ -128,6 +130,8 @@ def CopyAction(option, opt, value, parser):
|
|||
|
||||
def MoveAction(option, opt, value, parser):
|
||||
errorIfMultipleOption(parser.rargs)
|
||||
if(len(parser.rargs) == 0 ):
|
||||
raise OptionValueError("No argument found. This option requires at least one argument.")
|
||||
stor = helper_get_stor_dir()
|
||||
if(stor is None):
|
||||
exit("Unable to connect to the Airtime server.")
|
||||
|
@ -274,7 +278,7 @@ if('-l' in sys.argv or '--link' in sys.argv):
|
|||
if('-h' in sys.argv):
|
||||
printHelp()
|
||||
sys.exit()
|
||||
if(len(sys.argv) == 1):
|
||||
if(len(sys.argv) == 1 or '-' not in sys.argv[1]):
|
||||
printHelp()
|
||||
sys.exit()
|
||||
|
||||
|
|
Loading…
Reference in New Issue