add capture_opts_trim(), as this sequence is used three times now (will replace the...