Re: [libvirt] [PATCH v4 1/8] vsh: Enforce checking for missing help string
On 20/09/16 14:43, Ján Tomko wrote: > On Mon, Sep 19, 2016 at 03:00:26PM +0200, Erik Skultety wrote: >> The intention is to move vshCmddefCheckInternals out of >> vshCmddefOptParse to >> our test suite. First step to do that is to enforce checking for an >> existing >> help string (that also means it's non-empty) in a command because a >> command >> without a help is not much of a use. >> >> Signed-off-by: Erik Skultety>> --- >> tools/vsh.c | 5 + >> 1 file changed, 5 insertions(+) >> > > ACK > > Jan Thanks, as I said in on of the latter patches, I adjusted the patches according to your notes and pushed the series. Erik -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v4 1/8] vsh: Enforce checking for missing help string
On Mon, Sep 19, 2016 at 03:00:26PM +0200, Erik Skultety wrote: The intention is to move vshCmddefCheckInternals out of vshCmddefOptParse to our test suite. First step to do that is to enforce checking for an existing help string (that also means it's non-empty) in a command because a command without a help is not much of a use. Signed-off-by: Erik Skultety--- tools/vsh.c | 5 + 1 file changed, 5 insertions(+) ACK Jan signature.asc Description: Digital signature -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list
[libvirt] [PATCH v4 1/8] vsh: Enforce checking for missing help string
The intention is to move vshCmddefCheckInternals out of vshCmddefOptParse to our test suite. First step to do that is to enforce checking for an existing help string (that also means it's non-empty) in a command because a command without a help is not much of a use. Signed-off-by: Erik Skultety--- tools/vsh.c | 5 + 1 file changed, 5 insertions(+) diff --git a/tools/vsh.c b/tools/vsh.c index 4ee472c..f3b3fca 100644 --- a/tools/vsh.c +++ b/tools/vsh.c @@ -328,6 +328,11 @@ static int vshCmddefCheckInternals(const vshCmdDef *cmd) { size_t i; +const char *help = NULL; + +/* Each command has to provide a non-empty help string. */ +if (!(help = vshCmddefGetInfo(cmd, "help")) || !*help) +return -1; if (!cmd->opts) return 0; -- 2.5.5 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list