if (!vshCmdHasOption(ctl, cmd, optname))
return NULL;
- if (vshCommandOptString(cmd, optname, &n) <= 0)
+ if (vshCommandOptStringReq(ctl, cmd, optname, &n) < 0)
return NULL;
vshDebug(ctl, VSH_ERR_INFO, "%s: found option <%s>: %s\n",
bool ret = true;
char *buffer;
- if (vshCommandOptString(cmd, "file", &from) <= 0)
+ if (vshCommandOptStringReq(ctl, cmd, "file", &from) < 0)
return false;
if (virFileReadAll(from, VSH_MAX_XML_FILE, &buffer) < 0)
}
/* Name for new bridge device */
- if (vshCommandOptString(cmd, "bridge", &br_name) <= 0) {
- vshError(ctl, "%s", _("Missing bridge device name in command"));
+ if (vshCommandOptStringReq(ctl, cmd, "bridge", &br_name) < 0)
goto cleanup;
- }
/* make sure "new" device doesn't already exist */
if ((br_handle = virInterfaceLookupByName(ctl->conn, br_name))) {