From 091ac2202d2e0070025da55af2a7876243e00cd8 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 22 Jan 2015 11:01:13 +0000 Subject: [PATCH] Show the full reference in repo-contents when using --show-details It's useful to know if the ref is an application or a runtime, as each uses a different command line command. --- xdg-app-builtins-repo-contents.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/xdg-app-builtins-repo-contents.c b/xdg-app-builtins-repo-contents.c index ce760b65..591c49b4 100644 --- a/xdg-app-builtins-repo-contents.c +++ b/xdg-app-builtins-repo-contents.c @@ -173,24 +173,32 @@ xdg_app_builtin_repo_contents (int argc, char **argv, GCancellable *cancellable, if (g_str_has_prefix (ref, "runtime/") && !opt_only_apps) { - name = g_strdup (ref + strlen ("runtime/")); if (!opt_show_details) { + name = g_strdup (ref + strlen ("runtime/")); p = strchr (name, '/'); if (p) *p = 0; } + else + { + name = g_strdup (ref); + } } if (g_str_has_prefix (ref, "app/") && !opt_only_runtimes) { - name = g_strdup (ref + strlen ("app/")); if (!opt_show_details) { + name = g_strdup (ref + strlen ("app/")); p = strchr (name, '/'); if (p) *p = 0; } + else + { + name = g_strdup (ref); + } } if (name)