helper/command: handle empty "usage" with add_help_text/add_usage_text
commitc19de41a0f49ee11eb474c51dc243383047bd663
authorAntonio Borneo <borneo.antonio@gmail.com>
Sat, 30 Mar 2019 10:19:47 +0000 (30 11:19 +0100)
committerTomas Vanek <vanekt@fbl.cz>
Sun, 7 Apr 2019 07:19:52 +0000 (7 08:19 +0100)
tree313e2544534a9963634c0cff9b5ffca37e616fcf
parentb61e454869c988e7fafc1c16982ccfec04415b51
helper/command: handle empty "usage" with add_help_text/add_usage_text

By using the command "add_help_text" to add a help text to a TCL
procedure it implicitly creates a new command_registration struct
that has field .usage set to NULL. This triggers a debug message
BUG: command '%s' does not have the '.usage' field filled out

Use an empty string if usage field is NULL.

Plus, do not annoy the user with a LOG_INFO when the command
"add_usage_text" replaces an empty usage.

Change-Id: I4a72646e0fb704ba354f938d774055540cde3967
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: http://openocd.zylin.com/5025
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
src/helper/command.c