def setup_options(session, args):
    """Sets streamlink options."""
    if args.hls_live_edge:
        session.set_option('hls-live-edge', args.hls_live_edge)
    if args.hls_segment_attempts:
        session.set_option('hls-segment-attempts', args.hls_segment_attempts)
    if args.hls_playlist_reload_attempts:
        session.set_option('hls-playlist-reload-attempts', args.
            hls_playlist_reload_attempts)
    if args.hls_segment_threads:
        session.set_option('hls-segment-threads', args.hls_segment_threads)
    if args.hls_segment_timeout:
        session.set_option('hls-segment-timeout', args.hls_segment_timeout)
    if args.hls_segment_ignore_names:
        session.set_option('hls-segment-ignore-names', args.
            hls_segment_ignore_names)
    if args.hls_timeout:
        session.set_option('hls-timeout', args.hls_timeout)
    if args.hls_audio_select:
        session.set_option('hls-audio-select', args.hls_audio_select)
    if args.hls_start_offset:
        session.set_option('hls-start-offset', args.hls_start_offset)
    if args.hls_duration:
        session.set_option('hls-duration', args.hls_duration)
    if args.hls_live_restart:
        session.set_option('hls-live-restart', args.hls_live_restart)
    if args.hds_live_edge:
        session.set_option('hds-live-edge', args.hds_live_edge)
    if args.hds_segment_attempts:
        session.set_option('hds-segment-attempts', args.hds_segment_attempts)
    if args.hds_segment_threads:
        session.set_option('hds-segment-threads', args.hds_segment_threads)
    if args.hds_segment_timeout:
        session.set_option('hds-segment-timeout', args.hds_segment_timeout)
    if args.hds_timeout:
        session.set_option('hds-timeout', args.hds_timeout)
    if args.http_stream_timeout:
        session.set_option('http-stream-timeout', args.http_stream_timeout)
    if args.ringbuffer_size:
        session.set_option('ringbuffer-size', args.ringbuffer_size)
    if args.rtmp_proxy:
        session.set_option('rtmp-proxy', args.rtmp_proxy)
    if args.rtmp_rtmpdump:
        session.set_option('rtmp-rtmpdump', args.rtmp_rtmpdump)
    if args.rtmp_timeout:
        session.set_option('rtmp-timeout', args.rtmp_timeout)
    if args.stream_segment_attempts:
        session.set_option('stream-segment-attempts', args.
            stream_segment_attempts)
    if args.stream_segment_threads:
        session.set_option('stream-segment-threads', args.
            stream_segment_threads)
    if args.stream_segment_timeout:
        session.set_option('stream-segment-timeout', args.
            stream_segment_timeout)
    if args.stream_timeout:
        session.set_option('stream-timeout', args.stream_timeout)
    if args.ffmpeg_ffmpeg:
        session.set_option('ffmpeg-ffmpeg', args.ffmpeg_ffmpeg)
    if args.ffmpeg_verbose:
        session.set_option('ffmpeg-verbose', args.ffmpeg_verbose)
    if args.ffmpeg_verbose_path:
        session.set_option('ffmpeg-verbose-path', args.ffmpeg_verbose_path)
    if args.ffmpeg_video_transcode:
        session.set_option('ffmpeg-video-transcode', args.
            ffmpeg_video_transcode)
    if args.ffmpeg_audio_transcode:
        session.set_option('ffmpeg-audio-transcode', args.
            ffmpeg_audio_transcode)
    session.set_option('subprocess-errorlog', args.subprocess_errorlog)
    session.set_option('subprocess-errorlog-path', args.
        subprocess_errorlog_path)
    session.set_option('locale', args.locale)
