[gegl] bin: open ui instead of showing usage with no args



commit ec944f30442b6c7d2be4999e54dee05a89d71b2f
Author: Øyvind Kolås <pippin gimp org>
Date:   Wed May 29 12:26:06 2019 +0200

    bin: open ui instead of showing usage with no args

 bin/gegl-options.c | 8 ++++++--
 bin/gegl.c         | 1 -
 bin/ui-core.c      | 3 +--
 3 files changed, 7 insertions(+), 5 deletions(-)
---
diff --git a/bin/gegl-options.c b/bin/gegl-options.c
index 112c5d916..b10f1f248 100644
--- a/bin/gegl-options.c
+++ b/bin/gegl-options.c
@@ -259,11 +259,15 @@ parse_args (int    argc,
     GeglOptions *o;
     char **curr;
 
+    o = opts_new ();
     if (argc==1) {
-        usage (argv[0]);
+#ifdef HAVE_MRG
+      o->mode = GEGL_RUN_MODE_DISPLAY;
+#else
+      usage (argv[0]);
+#endif
     }
 
-    o = opts_new ();
     curr = argv+1;
 
     while (*curr && !o->rest) {
diff --git a/bin/gegl.c b/bin/gegl.c
index 85c1a1b68..972b11c43 100644
--- a/bin/gegl.c
+++ b/bin/gegl.c
@@ -209,7 +209,6 @@ main (gint    argc,
         }
     }
 
-
   if (o->mode == GEGL_RUN_MODE_DISPLAY)
     {
 #if HAVE_MRG
diff --git a/bin/ui-core.c b/bin/ui-core.c
index fed6141cf..1d728e872 100644
--- a/bin/ui-core.c
+++ b/bin/ui-core.c
@@ -1341,8 +1341,7 @@ int mrg_ui_main (int argc, char **argv, char **ops)
     o->path = realpath (argv[1], NULL);
   else
     {
-      printf ("usage: %s <full-path-to-image>\n", argv[0]);
-      return -1;
+      o->path = g_strdup (g_get_home_dir ());
     }
 
 #ifdef HAVE_LUA


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