[gnome-software] Launcher: Add a commandline option to show details



commit d7384cea51b764be62339779aba4e61ca49d2b43
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Oct 17 22:47:58 2013 -0400

    Launcher: Add a commandline option to show details
    
    With this commit, you can now call
    
      gnome-software --details firefox
    
    to see the details page for firefox.

 src/gs-launcher.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/gs-launcher.c b/src/gs-launcher.c
index e07ff58..d873d53 100644
--- a/src/gs-launcher.c
+++ b/src/gs-launcher.c
@@ -49,6 +49,7 @@ gs_launcher_local_command_line (GApplication *app, gchar ***args, gint *status)
         GOptionContext *context;
         gchar *mode = NULL;
        gchar *search = NULL;
+       gchar *id = NULL;
         gboolean version = FALSE;
        gint argc;
         const GOptionEntry options[] = {
@@ -57,6 +58,8 @@ gs_launcher_local_command_line (GApplication *app, gchar ***args, gint *status)
                   _("Start up mode: either ‘updates’, ‘updated’, ‘installed’ or ‘overview’"), _("MODE") },
                { "search", '\0', 0, G_OPTION_ARG_STRING, &search,
                  _("Search for applications"), _("SEARCH") },
+               { "details", '\0', 0, G_OPTION_ARG_STRING, &id,
+                 _("Show application details"), _("ID") },
                 { "version", 0, 0, G_OPTION_ARG_NONE, &version, NULL, NULL },
 
                 { NULL}
@@ -95,6 +98,10 @@ gs_launcher_local_command_line (GApplication *app, gchar ***args, gint *status)
                g_action_group_activate_action (G_ACTION_GROUP (app),
                                                "search",
                                                g_variant_new_string (search));
+       } else if (id != NULL) {
+               g_action_group_activate_action (G_ACTION_GROUP (app),
+                                               "details",
+                                               g_variant_new ("(ss)", id, ""));
        } else {
                g_application_activate (app);
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]