cli: fix completion of help sub-command

'help' is completed without considering other alternatives:

 # nmcli connection modify h<TAB>
 help

After the patch:
 # nmcli connection modify h<TAB>
 help
 home-wifi

Fixes: 29bb6ae4fe
This commit is contained in:
Beniamino Galvani 2018-02-13 10:32:11 +01:00
parent de9b74452c
commit 6cba687bb3

View file

@ -1235,9 +1235,8 @@ nmc_do_cmd (NmCli *nmc, const NMCCommand cmds[], const char *cmd, int argc, char
/* A valid command was specified. */
if (c->usage && argc == 2 && nmc->complete)
nmc_complete_help (*(argv+1));
if (c->usage && nmc_arg_is_help (*(argv+1))) {
if (!nmc->complete)
c->usage ();
if (!nmc->complete && c->usage && nmc_arg_is_help (*(argv+1))) {
c->usage ();
g_simple_async_result_complete_in_idle (simple);
g_object_unref (simple);
} else {