On 14/09/16 10:17, Michal Privoznik wrote: > This command should be exposed to other shells of ours. > They are gonna need it as soon as we want to test them too. > > Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx> > --- > tools/virsh.c | 45 +-------------------------------------------- > tools/vsh.c | 38 ++++++++++++++++++++++++++++++++++++++ > tools/vsh.h | 11 +++++++++++ > 3 files changed, 50 insertions(+), 44 deletions(-) > > diff --git a/tools/virsh.c b/tools/virsh.c > index cb60edc..1068447 100644 > --- a/tools/virsh.c > +++ b/tools/virsh.c > @@ -346,44 +346,6 @@ virshConnectionHandler(vshControl *ctl) > return NULL; > } > > -/* ----------------- > - * Command self-test > - * ----------------- */ > - > -static const vshCmdInfo info_selftest[] = { > - {.name = "help", > - .data = N_("internal command for testing virsh") > - }, > - {.name = "desc", > - .data = N_("internal use only") > - }, > - {.name = NULL} > -}; > - > -/* Prints help for every command. > - * That runs vshCmddefOptParse which validates > - * the per-command options structure. */ > -static bool > -cmdSelfTest(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) > -{ > - const vshCmdGrp *grp; > - const vshCmdDef *def; > - > - vshPrint(ctl, "Do not use the following output:\n\n"); > - > - for (grp = cmdGroups; grp->name; grp++) { > - for (def = grp->commands; def->name; def++) { > - if (def->flags & VSH_CMD_FLAG_ALIAS) > - continue; > - > - if (!vshCmddefHelp(ctl, def->name)) > - return false; > - } > - } > - > - return true; > -} > - > > /* --------------- > * Misc utils > @@ -894,18 +856,13 @@ static const vshCmdDef virshCmds[] = { > VSH_CMD_HELP, > VSH_CMD_PWD, > VSH_CMD_QUIT, > + VSH_CMD_SELF_TEST, > {.name = "connect", > .handler = cmdConnect, > .opts = opts_connect, > .info = info_connect, > .flags = VSH_CMD_FLAG_NOCONNECT > }, > - {.name = "self-test", > - .handler = cmdSelfTest, > - .opts = NULL, > - .info = info_selftest, > - .flags = VSH_CMD_FLAG_NOCONNECT | VSH_CMD_FLAG_ALIAS > - }, > {.name = NULL} > }; > > diff --git a/tools/vsh.c b/tools/vsh.c > index be6a073..c51bdd7 100644 > --- a/tools/vsh.c > +++ b/tools/vsh.c > @@ -3328,3 +3328,41 @@ cmdQuit(vshControl *ctl, const vshCmd *cmd ATTRIBUTE_UNUSED) > ctl->imode = false; > return true; > } > + > +/* ----------------- > + * Command self-test > + * ----------------- */ > + > +const vshCmdInfo info_selftest[] = { > + {.name = "help", > + .data = N_("internal command for testing virsh") > + }, s/virsh/virt shells/ or something alike you can come up with :) ACK Erik -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list