- for (i = 0; i < (int)sz; i++)
- printf("%s(%s%s%s) - %s\n", res[i].title,
- res[i].cat,
- *res[i].arch ? "/" : "",
- *res[i].arch ? res[i].arch : "",
- res[i].desc);
+ if (EMPTYSET(res, sz) || SINGLETON(res, sz))
+ return;
+
+ if ( ! isatty(STDOUT_FILENO))
+ for (i = 0; i < sz && res[i].matched; i++)
+ printf("%s(%s%s%s) - %.70s\n",
+ res[i].title, res[i].cat,
+ *res[i].arch ? "/" : "",
+ *res[i].arch ? res[i].arch : "",
+ res[i].desc);
+ else
+ for (i = 0; i < sz && res[i].matched; i++)
+ printf("[%zu] %s(%s%s%s) - %.70s\n", i + 1,
+ res[i].title, res[i].cat,
+ *res[i].arch ? "/" : "",
+ *res[i].arch ? res[i].arch : "",
+ res[i].desc);