From 8773306e22e15892560f9a5137ec9253087bc0c7 Mon Sep 17 00:00:00 2001 From: Seth Burgess Date: Sat, 11 Jul 1998 02:00:19 +0000 Subject: [PATCH] Added --gimprc command line option. --- ChangeLog | 6 ++++++ app/gimprc.c | 6 ++++++ app/main.c | 16 ++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4f27099f49..344ad40b1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +1998-07-10 Seth Burgess + + * app/main.c: + * app/gimprc.c: + Added commandline support for an alternate gimprc. + 1998-07-10 Chris Lahey * app/docindexif.c: diff --git a/app/gimprc.c b/app/gimprc.c index f5697beaf4..115628d28b 100644 --- a/app/gimprc.c +++ b/app/gimprc.c @@ -248,6 +248,7 @@ static SessionGeometry *session_geometries[] = }; static int nsession_geometries = sizeof (session_geometries) / sizeof (session_geometries[0]); +extern char* alternate_gimprc; #define MAX_GIMPDIR_LEN 500 @@ -347,6 +348,11 @@ parse_gimprc_file (char *filename) filename = rfilename; } + if (alternate_gimprc != NULL) + { + filename = alternate_gimprc; + } + parse_info.fp = fopen (filename, "rt"); if (!parse_info.fp) return; diff --git a/app/main.c b/app/main.c index 0dfe0f4e3a..9b8506c3a7 100644 --- a/app/main.c +++ b/app/main.c @@ -52,6 +52,7 @@ GimpSet* image_context; MessageHandlerType message_handler; char *prog_name; /* The path name we are invoked with */ +char *alternate_gimprc; char **batch_cmds; /* LOCAL data */ @@ -117,6 +118,8 @@ main (int argc, char **argv) batch_cmds = g_new (char*, argc); batch_cmds[0] = NULL; + + alternate_gimprc = NULL; show_version = FALSE; show_help = FALSE; @@ -140,6 +143,18 @@ main (int argc, char **argv) } batch_cmds[j] = NULL; } + else if ((strcmp (argv[i], "--gimprc") == 0) || + (strcmp (argv[i], "-g") == 0)) + { + if (argc <= ++i) + { + show_help = TRUE; + } + else + { + alternate_gimprc = argv[i]; + } + } else if ((strcmp (argv[i], "--help") == 0) || (strcmp (argv[i], "-h") == 0)) { @@ -197,6 +212,7 @@ main (int argc, char **argv) g_print (" -h --help Output this help.\n"); g_print (" -v --version Output version info.\n"); g_print (" -b --batch Run in batch mode.\n"); + g_print (" -g --gimprc Use an alternate gimprc file\n"); g_print (" -n --no-interface Run without a user interface.\n"); g_print (" --no-data Do not load patterns, gradients, palettes, brushes.\n"); g_print (" --verbose Show startup messages.\n");