code: def main():
      
  
      parser = argparse.ArgumentParser(description='Convert ULog to CSV')
      parser.add_argument('filename', metavar='file.ulg', help='ULog input file')
  
      parser.add_argument(
          '-m', '--messages', dest='messages',
          help=("Only consider given messages. Must be a comma-separated list of"
                " names, like 'sensor_combined,vehicle_gps_position'"))
      parser.add_argument('-d', '--delimiter', dest='delimiter', action='store',
                          help="Use delimiter in CSV (default is ',')", default=',')
  
  
      parser.add_argument('-o', '--output', dest='output', action='store',
                          help='Output directory (default is same as input file)',
                          metavar='DIR')
  
      args = parser.parse_args()
  
      if args.output and not os.path.isdir(args.output):
          print('Creating output directory {:}'.format(args.output))
          os.mkdir(args.output)
  
      convert_ulog2csv(args.filename, args.messages, args.output, args.delimiter)
docs: Command line interface