Index: lpstat.c =================================================================== --- lpstat.c (revision 5591) +++ lpstat.c (working copy) @@ -1396,9 +1396,11 @@ int ranking, /* I - Show job ranking? */ const char *which) /* I - Show which jobs? */ { + int i; /* Looping var */ ipp_t *request, /* IPP Request */ *response; /* IPP Response */ - ipp_attribute_t *attr; /* Current attribute */ + ipp_attribute_t *attr, /* Current attribute */ + *reasons; /* Job state reasons attribute */ const char *dest, /* Pointer into job-printer-uri */ *username, /* Pointer to job-originating-user-name */ *title; /* Pointer to job-name */ @@ -1419,7 +1421,8 @@ "job-name", "time-at-creation", "job-printer-uri", - "job-originating-user-name" + "job-originating-user-name", + "job-state-reasons" }; @@ -1494,6 +1497,7 @@ dest = NULL; jobtime = 0; title = "no title"; + reasons = NULL; while (attr != NULL && attr->group_tag == IPP_TAG_JOB) { @@ -1522,6 +1526,10 @@ attr->value_tag == IPP_TAG_NAME) title = attr->values[0].string.text; + if (!strcmp(attr->name, "job-state-reasons") && + attr->value_tag == IPP_TAG_KEYWORD) + reasons = attr; + attr = attr->next; } @@ -1664,7 +1672,17 @@ temp, username ? username : "unknown", 1024.0 * size, date); if (long_status) + { + if (reasons) + { + _cupsLangPuts(stdout, _("\tAlerts:")); + for (i = 0; i < reasons->num_values; i ++) + _cupsLangPrintf(stdout, " %s", + reasons->values[i].string.text); + _cupsLangPuts(stdout, "\n"); + } _cupsLangPrintf(stdout, _("\tqueued for %s\n"), dest); + } } }