def report_command(cmd, params, main, fileout):
    """Report command line options."""
    txt = cmd + ' \\\n'
    for key in sorted(params.keys()):
        if key in main:
            continue
        flag = key.replace('_', '-')
        value = params[key]
        if value is None or value is False:
            continue
        if value is True:
            value = ''
        txt += ' --%s %s \\\n' % (flag, value)
    txt += ' '.join([params[key] for key in main])
    if fileout is not None:
        with open(fileout, 'w') as fh:
            fh.write(txt)
    return txt
