[gnome-software] Launcher: Add a commandline option to start a search



commit c0dae7eaed97ee532e436e9a87c907878b3a40af
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 11 20:53:25 2013 -0400

    Launcher: Add a commandline option to start a search
    
    This brings back the --search-value functionality in slightly
    different form. You can now call
    
      gnome-software --search fox
    
    to find foxes.

 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 b0b6ee7..e07ff58 100644
--- a/src/gs-launcher.c
+++ b/src/gs-launcher.c
@@ -48,12 +48,15 @@ gs_launcher_local_command_line (GApplication *app, gchar ***args, gint *status)
 {
         GOptionContext *context;
         gchar *mode = NULL;
+       gchar *search = NULL;
         gboolean version = FALSE;
        gint argc;
         const GOptionEntry options[] = {
                 { "mode", '\0', 0, G_OPTION_ARG_STRING, &mode,
                   /* TRANSLATORS: this is a command line option */
                   _("Start up mode: either ‘updates’, ‘updated’, ‘installed’ or ‘overview’"), _("MODE") },
+               { "search", '\0', 0, G_OPTION_ARG_STRING, &search,
+                 _("Search for applications"), _("SEARCH") },
                 { "version", 0, 0, G_OPTION_ARG_NONE, &version, NULL, NULL },
 
                 { NULL}
@@ -88,6 +91,10 @@ gs_launcher_local_command_line (GApplication *app, gchar ***args, gint *status)
                g_action_group_activate_action (G_ACTION_GROUP (app),
                                                "set-mode",
                                                g_variant_new_string (mode));
+       } else if (search != NULL) {
+               g_action_group_activate_action (G_ACTION_GROUP (app),
+                                               "search",
+                                               g_variant_new_string (search));
        } else {
                g_application_activate (app);
        }


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