add: if (argc < 4 || argc > 5) { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ?-once? ?-thread? day hour minute " "{ script | procname ?arg? }\"", (char *) NULL); return TCL_ERROR; }
context: NsTclSchedWeeklyCmd(ClientData arg, Tcl_Interp *interp, int argc,		     char **argv){    Callback    *cbPtr;    int          flags;    int          first;    int          id;    int          day, hour, minute;    /* 12 cases (arg count & number after cmd and -options are handled):     *     0    1        2        3        4     5       6      7     *  * cmd day      hour     minute  script                       (5 args)/4     *  * cmd day      hour     minute  proc                         (5 args)/4     *  * cmd day      hour     minute  proc    arg                  (6 args)/5     *  * cmd -once    day      hour    minute  script               (6 args)/4     *  * cmd -once    day      hour    minute  proc                 (6 args)/4     *  * cmd -once    day      hour    minute  proc    arg          (7 args)/5     *  * cmd -thread  day      hour    minute  script               (6 args)/4     *  * cmd -thread  day      hour    minute  proc                 (6 args)/4     *  * cmd -thread  day      hour    minute  proc    arg          (7 args)/5     *  * cmd -once    -thread  day     hour    minute  script       (7 args)/4     *  * cmd -once    -thread  day     hour    minute  proc         (7 args)/4     *  * cmd -once    -thread  day     hour    minute  proc    arg  (8 args)/5     */    if (argc < 5 || argc > 8) {        Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],			 " ?-once? ?-thread? day hour minute "			 "{ script | procname ?arg? }\"", (char *) NULL);        return TCL_ERROR;    }    first = 1;    flags = 0;    while (argc--) {        if (strcmp(argv[first], "-thread") == 0) {            flags |= NS_SCHED_THREAD;        } else if (strcmp(argv[first], "-once") == 0) {            flags |= NS_SCHED_ONCE;        } else {	    break;        }        first++;    }    /*     * First is now the first argument that is not a switch.     */    if (Tcl_GetInt(interp, argv[first++], &day) != TCL_OK) {        return TCL_ERROR;    }    if (day < 0 || day > 6) {        Tcl_AppendResult(interp, "invalid day \"", argv[first - 1],			 "\": should be >= 0 and <= 6", NULL);        return TCL_ERROR;    }    if (Tcl_GetInt(interp, argv[first++], &hour) != TCL_OK) {        return TCL_ERROR;    }    if (hour < 0 || hour > 23) {        Tcl_AppendResult(interp, "invalid hour \"", argv[first - 1],			 "\": should be >= 0 and <= 23", NULL);        return TCL_ERROR;    }    if (Tcl_GetInt(interp, argv[first++], &minute) != TCL_OK) {        return TCL_ERROR;    }    if (minute < 0 || minute > 59) {        Tcl_AppendResult(interp, "invalid minute \"", argv[first - 1],			 "\": should be >= 0 and <= 59", NULL);        return TCL_ERROR;    }    cbPtr = NewCallback(interp, argv[first], argv[first+1]);    id = Ns_ScheduleWeekly(NsTclSchedProc, cbPtr, flags,    	    	    	   day, hour, minute, FreeSched);    return ReturnValidId(interp, id, cbPtr);}