[gnome-builder] app: be smarter about libtool prefixes



commit 008dc9aa315fff6fa11188c981a28c770eb5d9d5
Author: Christian Hergert <christian hergert me>
Date:   Mon Nov 23 13:56:50 2015 -0800

    app: be smarter about libtool prefixes

 libide/ide-application-command-line.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)
---
diff --git a/libide/ide-application-command-line.c b/libide/ide-application-command-line.c
index ac69f2b..525ace1 100644
--- a/libide/ide-application-command-line.c
+++ b/libide/ide-application-command-line.c
@@ -146,6 +146,7 @@ ide_application_local_command_line (GApplication   *application,
   GOptionContext *context = NULL;
   GOptionGroup *group;
   const gchar *shortdesc = NULL;
+  const gchar *prgname;
   GError *error = NULL;
   gchar *type = NULL;
   gchar *dbus_address = NULL;
@@ -202,7 +203,11 @@ ide_application_local_command_line (GApplication   *application,
 
   *exit_status = EXIT_SUCCESS;
 
-  if (g_str_equal (g_get_prgname (), "ide"))
+  prgname = g_get_prgname ();
+  if (prgname && g_str_has_prefix (prgname, "lt-"))
+    prgname += strlen ("lt-");
+
+  if (g_str_equal (prgname, "ide"))
     shortdesc = _("COMMAND");
 
   context = g_option_context_new (shortdesc);
@@ -221,8 +226,7 @@ ide_application_local_command_line (GApplication   *application,
    * If we are the "ide" program, then we want to setup ourselves for
    * verb style commands and add a commands group for help.
    */
-  if (g_str_equal (g_get_prgname (), "ide") ||
-      g_str_equal (g_get_prgname (), "lt-ide"))
+  if (g_str_equal (prgname, "ide"))
     {
       gchar *command_help;
 
@@ -234,8 +238,7 @@ ide_application_local_command_line (GApplication   *application,
       g_option_context_set_summary (context, command_help);
       g_free (command_help);
     }
-  else if (g_str_equal (g_get_prgname (), "gnome-builder-worker") ||
-           g_str_equal (g_get_prgname (), "lt-gnome-builder-worker"))
+  else if (g_str_equal (prgname, "gnome-builder-worker"))
     {
       self->mode = IDE_APPLICATION_MODE_WORKER;
     }


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