TEST ONLY: this is called if run from command line

def main(argv=None):
    '''TEST ONLY: this is called if run from command line'''

    parser = argparse.ArgumentParser()
    parser.add_argument('-i','--input_file', required=True)
    parser.add_argument('--input_file_format', default='sequence')
    parser.add_argument('--input_data_type', default='json')
    parser.add_argument('--input_separator', default='\t')
    parser.add_argument('-o','--output_dir', required=True)
    parser.add_argument('--output_file_format', default='sequence')
    parser.add_argument('--output_data_type', default='json')
    parser.add_argument('--output_separator', default='\t')
    args=parser.parse_args()

    # can be inconvenient to specify tab on the command line
    args.input_separator = "\t" if args.input_separator=='tab' else args.input_separator
    args.output_separator = "\t" if args.output_separator=='tab' else args.output_separator

    sc = SparkContext(appName="fileUtil")
    fUtil = FileUtil(sc)

    ## CONFIG LOAD
    input_kwargs = {"file_format": args.input_file_format,
                   "data_type": args.input_data_type}
    parse_kwargs = {"separator": args.input_separator}
    load_kwargs = merge_dicts(input_kwargs, parse_kwargs)
    
    ## LOAD
    rdd = fUtil.load_file(args.input_file, **load_kwargs)

    ## CONFIG SAVE
    output_kwargs = {"file_format": args.output_file_format,
                     "data_type": args.output_data_type}
    emit_kwargs = {"separator": args.output_separator}
    save_kwargs = merge_dicts(output_kwargs, emit_kwargs)

    ## SAVE
    fUtil.save_file(rdd, args.output_dir, **save_kwargs)