summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2016-08-23 14:43:14 +0100
committerRichard Hughes <richard@hughsie.com>2016-08-23 14:50:50 +0100
commit72ccf9f3b2f45dcb75590f9eb8b4d2cdfbfd676d (patch)
tree8426f96482654f83a772694f5aafaaaddca3c299
parent9b36119e1ed8ae7c2bec341143c343a9d73dcdd8 (diff)
downloadappstream-glib-72ccf9f3b2f45dcb75590f9eb8b4d2cdfbfd676d.tar.gz
trivial: Show the installed state in the appstream-util search output
-rw-r--r--client/as-util.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/client/as-util.c b/client/as-util.c
index 8d51ad8..e60fc06 100644
--- a/client/as-util.c
+++ b/client/as-util.c
@@ -1253,9 +1253,18 @@ as_util_search (AsUtilPrivate *priv, gchar **values, GError **error)
g_ptr_array_sort (array, as_util_sort_apps_by_sort_key_cb);
for (i = 0; i < array->len; i++) {
app = g_ptr_array_index (array, i);
- g_print ("[%s] %s\n",
- as_app_get_metadata_item (app, "SortKey"),
- as_app_get_unique_id (app));
+ switch (as_app_get_state (app)) {
+ case AS_APP_STATE_INSTALLED:
+ g_print ("[%s] %s (installed)\n",
+ as_app_get_metadata_item (app, "SortKey"),
+ as_app_get_unique_id (app));
+ break;
+ default:
+ g_print ("[%s] %s\n",
+ as_app_get_metadata_item (app, "SortKey"),
+ as_app_get_unique_id (app));
+ break;
+ }
}
/* dump XML */