summaryrefslogtreecommitdiffstats
path: root/expac.c
diff options
context:
space:
mode:
Diffstat (limited to 'expac.c')
-rw-r--r--expac.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/expac.c b/expac.c
index 85dcc19..ee057aa 100644
--- a/expac.c
+++ b/expac.c
@@ -57,6 +57,7 @@ const char *format = NULL;
const char *timefmt = NULL;
const char *listdelim = NULL;
const char *delim = NULL;
+int pkgcounter = 0;
typedef const char *(*extractfn)(void*);
@@ -406,6 +407,9 @@ static int print_pkg(pmpkg_t *pkg, const char *format) {
case 'w': /* install reason */
out += printf(fmt, alpm_pkg_get_reason(pkg) ? "dependency" : "explicit");
break;
+ case '!': /* result number */
+ out += printf("%d", pkgcounter++);
+ break;
/* times */
case 'b': /* build date */