def get_config_from_options(**options):
    """Get config file fragment reflecting command-line options."""
    data = []
    data.append('[supervisord]\n')
    if options.get('daemonize', False):
        data.append('nodaemon=false\n')
    else:
        data.append('nodaemon=true\n')
    if options.get('pidfile', None):
        data.append('pidfile=%s\n' % (options['pidfile'],))
    if options.get('logfile', None):
        data.append('logfile=%s\n' % (options['logfile'],))
    for progname in (options.get('launch', None) or []):
        data.append('[program:%s]\nautostart=true\n' % (progname,))
    for progname in (options.get('nolaunch', None) or []):
        data.append('[program:%s]\nautostart=false\n' % (progname,))
    for progname in (options.get('include', None) or []):
        data.append('[program:%s]\nexclude=false\n' % (progname,))
    for progname in (options.get('exclude', None) or []):
        data.append('[program:%s]\nexclude=true\n' % (progname,))
    if options.get('autoreload', None):
        data.append('[program:autoreload]\nexclude=false\nautostart=true\n')
        data.append('[program:__defaults__]\nautoreload=false\n')
        for progname in options['autoreload']:
            data.append('[program:%s]\nautoreload=true\n' % (progname,))
    if options.get('noreload', False):
        data.append('[program:autoreload]\nexclude=true\n')
    return ''.join(data)
