OSDN Git Service

monitor: refine monitor_find_completion()
authorWenchao Xia <xiawenc@linux.vnet.ibm.com>
Tue, 27 Aug 2013 12:38:24 +0000 (20:38 +0800)
committerLuiz Capitulino <lcapitulino@redhat.com>
Fri, 30 Aug 2013 11:41:15 +0000 (07:41 -0400)
commitc35b6400338897847bbab1b0f65d89552636579a
treea19b46f8bd059259b5b5ddaacf0494c45128387b
parent66855495fbcca9411a21e6eba6a3a0385007c96d
monitor: refine monitor_find_completion()

In order to support sub command in auto completion, a reentrant function
is needed, so monitor_find_completion() is split into two parts. The
first part does parsing of user input which need to be done only once,
the second part does the auto completion job according to the parsing
result, which contains the necessary code to support sub command and
works as the reentrant function. The global "info_cmds" is still used
in second part, which will be replaced by sub command code later.

Signed-off-by: Wenchao Xia <xiawenc@linux.vnet.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
monitor.c