From 881d08ddbd3ff8eac3bb53303868b8976323ce49 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Fri, 21 Nov 2014 22:05:41 +0000 Subject: [PATCH] transport: clarify error message when transport is not selected When no transport is selected, the error message dumps the available transports, but not how to actually select one. Change-Id: I63da2a4b59e3f6cc8d30bd631e41a82636a056ef Signed-off-by: Karl Palsson Signed-off-by: Paul Fertser Reviewed-on: http://openocd.zylin.com/2406 Tested-by: jenkins Reviewed-by: Spencer Oliver --- src/transport/transport.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/transport/transport.c b/src/transport/transport.c index 3f5337e35..c57064bbd 100644 --- a/src/transport/transport.c +++ b/src/transport/transport.c @@ -239,12 +239,13 @@ COMMAND_HANDLER(handle_transport_init) { LOG_DEBUG("%s", __func__); if (!session) { - LOG_ERROR("session's transport is not selected."); + LOG_ERROR("session transport was not selected. Use 'transport select '"); /* no session transport configured, print transports then fail */ + LOG_ERROR("Transports available:"); const char * const *vector = allowed_transports; while (*vector) { - LOG_ERROR("allow transport '%s'", *vector); + LOG_ERROR("%s", *vector); vector++; } return ERROR_FAIL; @@ -277,7 +278,7 @@ static int jim_transport_select(Jim_Interp *interp, int argc, Jim_Obj * const *a switch (argc) { case 1: /* return/display */ if (!session) { - LOG_ERROR("session's transport is not selected."); + LOG_ERROR("session transport was not selected. Use 'transport select '"); return JIM_ERR; } else { Jim_SetResultString(interp, session->name, -1);