def parse_args(): default_output = formatted_filepath('output', datestamp=True) default_logger = formatted_filepath(suffix='log', sep='.') parser = optparse.OptionParser() parser.add_option("-i", "--input", default=None, help="Input") parser.add_option("-o", "--output", default=default_output, help="Output name") parser.add_option("-l", "--logger", default=default_logger, help="Log name") (options, args) = parser.parse_args() if not (options.input and options.output): parser.print_help() sys.exit(1) return (options, args)
def parse_args(): default_output = formatted_filepath('output', datestamp=True) default_logger = formatted_filepath(suffix='log', sep='.') parser = optparse.OptionParser() parser.add_option("", "--domain", default=None, help="Site name. Supported, hdfcsec") parser.add_option("", "--txn-type", default=None, help="Stock/MF") parser.add_option("", "--txn-files", default=None, help="Transaction csv/xls files. Multiple values supported as comma-separated-values") parser.add_option("-o", "--outdir", default=default_output, help="Output dir name") parser.add_option("-l", "--logfile", default=default_logger, help="Logfile name") (options, args) = parser.parse_args() if not (options.domain and options.txn_type and options.txn_files): parser.print_help() graceful_exit("Mandatory arguments missing!! Please try again") return (options, args)