<dt><b>-U </b><i>username</i>
<dd style="margin-left: 5.0em">Specifies an alternate username.
<dt><b>-W </b><i>which-jobs</i>
-<dd style="margin-left: 5.0em">Specifies which jobs to show, "completed" or "not-completed" (the default).
+<dd style="margin-left: 5.0em">Specifies which jobs to show, "all", "successful", "completed" or "not-completed" (the default).
This option <i>must</i> appear before the <i>-o</i> option and/or any printer names, otherwise the default ("not-completed") value will be used in the request to the scheduler.
<dt><b>-a </b>[<i>printer(s)</i>]
<dd style="margin-left: 5.0em">Shows the accepting state of printer queues.
if (i >= argc)
{
- _cupsLangPrintf(stderr, _("%s: Error - need \"completed\", \"not-completed\", or \"all\" after \"-W\" option."), argv[0]);
+ _cupsLangPrintf(stderr, _("%s: Error - need \"completed\", \"not-completed\", \"successful\", or \"all\" after \"-W\" option."), argv[0]);
usage();
}
which = argv[i];
}
- if (strcmp(which, "completed") && strcmp(which, "not-completed") && strcmp(which, "all"))
+ if (strcmp(which, "completed") && strcmp(which, "not-completed") && strcmp(which, "all") && strcmp(which, "successful"))
{
- _cupsLangPrintf(stderr, _("%s: Error - need \"completed\", \"not-completed\", or \"all\" after \"-W\" option."), argv[0]);
+ _cupsLangPrintf(stderr, _("%s: Error - need \"completed\", \"not-completed\", \"successful\", or \"all\" after \"-W\" option."), argv[0]);
usage();
}
break;
NULL, cupsUser());
ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_KEYWORD, "which-jobs",
- NULL, which);
+ NULL, !strcmp(which, "successful") ? "completed" : which);
/*
* Do the request and get back a response...
if (!strcmp(which, "aborted") ||
!strcmp(which, "canceled") ||
+ !strcmp(which, "successful") ||
!strcmp(which, "completed"))
time_at = "time-at-completed";
else
if (match_list(dests, dest) && match_list(users, username))
{
- snprintf(temp, sizeof(temp), "%s-%d", dest, jobid);
+ if (!strcmp(which, "successful") && (!reasons || (reasons &&
+ strcmp(reasons->values[0].string.text, "job-completed-successfully"))))
+ continue;
+
+ snprintf(temp, sizeof(temp), "%s-%d", dest, jobid);
_cupsStrDate(date, sizeof(date), jobtime);
int jobid; /* Job ID of current job */
char printer_uri[HTTP_MAX_URI],
/* Printer URI */
- printer_state_time[255];/* Printer state time */
+ printer_state_time[255];/* Printer state time */
_cups_globals_t *cg = _cupsGlobals(); /* Global data */
static const char *pattrs[] = /* Attributes we need for printers... */
{