Commit 470d8707 by Eric Coissac

Fixes #5 by printing the help message when oa is run without arguments

Signed-off-by: Eric Coissac <eric.coissac@metabarcoding.org>
parent b896d252
......@@ -121,8 +121,14 @@ def getLogger(config):
return rootlogger
class OaParser(argparse.ArgumentParser):
def error(self, message):
sys.stderr.write('error: %s\n' % message)
self.print_help()
sys.exit(2)
def buildArgumentParser():
parser = argparse.ArgumentParser()
parser = OaParser()
parser.add_argument('--version', dest='orgasm:version',
action='store_true',
......@@ -201,6 +207,11 @@ def getConfiguration():
print("The Organelle Assembler - Version %s" % __version__)
sys.exit(0)
if not 'module' in config['orgasm']:
print('\nError: No oa command specified',file=sys.stderr)
parser.print_help()
sys.exit(2)
if config['orgasm']['outputfilename'] is None:
config['orgasm']['outputfilename']=config['orgasm']['indexfilename']
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment