} else if ( cmd ) {
} else if ( cmd && *cmd) {
int processArgs(int argc, char **argv, int silent) {    char *cmdname=NULL;    char *conffile=NULL;    int cmdevent=0;    char *cmd=NULL;    char *logstring=NULL;    char *fac=NULL,*pri=NULL;    int lfac=-1, lpri=-1;    poptContext context;    int rc;    struct poptOption optTable[] = {	POPT_AUTOHELP	{ "conf", 0, POPT_ARG_STRING, &conffile, 0,	  "configuration file (default: /etc/initlog.conf)", NULL	},	{ "name", 'n', POPT_ARG_STRING, &cmdname, 0,	  "name of service being logged", NULL 	},	{ "event", 'e', POPT_ARG_INT, &cmdevent, 0,	  "event being logged (see man page)", NULL	},	{ "cmd", 'c', POPT_ARG_STRING, &cmd, 0,	  "command to run, logging output", NULL	},        { "debug", 'd', POPT_ARG_NONE, &debug, 0,	  "print lots of verbose debugging info", NULL	},	{ "run", 'r', POPT_ARG_STRING, &cmd, 3,	  "command to run, accepting input on open fd", NULL	},	{ "string", 's', POPT_ARG_STRING, &logstring, 0,	  "string to log", NULL	},	{ "facility", 'f', POPT_ARG_STRING, &fac, 1,	  "facility to log at (default: 'local7')", NULL	},	{ "priority", 'p', POPT_ARG_STRING, &pri, 2,	  "priority to log at (default: 'notice')", NULL	},        { "quiet", 'q', POPT_ARG_NONE, &quiet, 0,	  "suppress stdout/stderr", NULL	},        { 0, 0, 0, 0, 0, 0 }    };        context = poptGetContext("initlog", argc, argv, optTable, 0);        while ((rc = poptGetNextOpt(context)) > 0) {	switch (rc) {	 case 1:	    lfac=atoi(fac);	    if ((lfac == 0) && strcmp(fac,"0")) {		int x =0;				lfac = LOG_DAEMON;		for (x=0;facilitynames[x].c_name;x++) {		    if (!strcmp(fac,facilitynames[x].c_name)) {			lfac = facilitynames[x].c_val;			break;		    }		}	    }	    break;	 case 2:	    lpri = atoi(pri);	    if ((lpri == 0) && strcmp(pri,"0")) {		int x=0;				lpri = LOG_NOTICE;		for (x=0;prioritynames[x].c_name;x++) {		    if (!strcmp(pri,prioritynames[x].c_name)) {			lpri = prioritynames[x].c_val;			break;		    }		}	    }	    break;	 case 3:	    reexec = 1;	    break;	 default:	    break;	}    }          if ((rc < -1)) {       if (!silent)	 fprintf(stderr, "%s: %s\n",		poptBadOption(context, POPT_BADOPTION_NOALIAS),		poptStrerror(rc));       	return -1;    }    if ( (cmd && logstring) || (cmd && cmdname) ) {        if (!silent)	 fprintf(stderr, _("--cmd and --run are incompatible with --string or --name\n"));	return -1;    }    if ( cmdname && (!logstring && !cmdevent)) {        if (!silent)	 fprintf(stderr, _("--name requires one of --event or --string\n"));	return -1;    }    if (conffile) {	readConfiguration(conffile);    } else {	readConfiguration("/etc/initlog.conf");    }    if (lpri!=-1) logpriority=lpri;    if (lfac!=-1) logfacility=lfac;    if (cmdevent) {	logEvent(cmdname,cmdevent,logstring);    } else if (logstring) {	logString(cmdname,logstring);    } else if ( cmd ) {	return(runCommand(cmd,reexec,quiet,debug));    } else {        if (!silent)	 fprintf(stderr,"nothing to do!\n");	return -1;    }   return 0;}