added --license command-line option.

2005-12-29  Sven Neumann  <sven@gimp.org>

	* app/main.c: added --license command-line option.

	* docs/gimp.1.in: documented the new option.
This commit is contained in:
Sven Neumann 2005-12-29 18:39:03 +00:00 committed by Sven Neumann
parent aa590be77a
commit e341b0e319
3 changed files with 45 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2005-12-29 Sven Neumann <sven@gimp.org>
* app/main.c: added --license command-line option.
* docs/gimp.1.in: documented the new option.
2005-12-29 Sven Neumann <sven@gimp.org>
* app/widgets/gimpdockbook.c: set the source dockable insensitive

View File

@ -75,7 +75,8 @@ static gboolean gimp_option_dump_gimprc (const gchar *option_name,
gpointer data,
GError **error);
static void gimp_show_version (void) G_GNUC_NORETURN;
static void gimp_show_version_and_exit (void) G_GNUC_NORETURN;
static void gimp_show_license_and_exit (void) G_GNUC_NORETURN;
static void gimp_init_i18n (void);
static void gimp_init_malloc (void);
@ -118,9 +119,14 @@ static GimpPDBCompatMode pdb_compat_mode = GIMP_PDB_COMPAT_ON;
static const GOptionEntry main_entries[] =
{
{ "version", 'v', G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK, (GOptionArgFunc) gimp_show_version,
G_OPTION_ARG_CALLBACK, (GOptionArgFunc) gimp_show_version_and_exit,
N_("Show version information and exit"), NULL
},
{
"license", 0, G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK, (GOptionArgFunc) gimp_show_license_and_exit,
N_("Show license information and exit"), NULL
},
{
"verbose", 0, 0,
G_OPTION_ARG_NONE, &be_verbose,
@ -268,8 +274,7 @@ main (int argc,
}
else if ((strcmp (arg, "--version") == 0) || (strcmp (arg, "-v") == 0))
{
gimp_show_version ();
app_exit (EXIT_SUCCESS);
gimp_show_version_and_exit ();
}
}
@ -445,15 +450,32 @@ gimp_show_version (void)
{
g_print (_("%s version %s"), "GIMP", GIMP_VERSION);
g_print ("\n");
}
static void
gimp_show_version_and_exit (void)
{
gimp_show_version ();
app_exit (EXIT_SUCCESS);
}
static void
gimp_show_license_and_exit (void)
{
gimp_show_version ();
g_print ("\n");
g_print (GIMP_LICENSE);
g_print ("\n\n");
app_exit (EXIT_SUCCESS);
}
static void
gimp_init_malloc (void)
{
#if 0
#ifdef GIMP_GLIB_MEM_PROFILER
g_mem_set_vtable (glib_mem_profiler_table);
g_atexit (g_mem_profile);
#endif
@ -469,6 +491,9 @@ gimp_init_malloc (void)
*
* An alternative to tuning this parameter would be to use
* malloc_trim(), for example after releasing a large tile-manager.
*
* Another possibility is to switch to using GSlice as soon as this
* API is available in a stable GLib release.
*/
mallopt (M_MMAP_THRESHOLD, TILE_WIDTH * TILE_HEIGHT);
#endif

View File

@ -1,4 +1,4 @@
.TH GIMP 1 "April 6 2005" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.TH GIMP 1 "December 29 2005" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.SH NAME
gimp - an image manipulation and paint program.
@ -7,9 +7,9 @@ gimp - an image manipulation and paint program.
.SH SYNOPSIS
.B gimp
[\-h] [\-\-help] [\-\-help-all] [\-\-help-gtk] [-v] [\-\-version]
[\-\-verbose] [\-\-no\-shm] [\-\-no\-cpu\-accel] [\-\-display \fIdisplay\fP]
[\-d] [\-\-no\-data] [\-f] [\-\-no\-fonts] [\-i] [\-\-no\-interface]
[\-s] [\-\-no\-splash] [\-\-session \fI<name>\fP]
[\-\-license] [\-\-verbose] [\-\-no\-shm] [\-\-no\-cpu\-accel]
[\-\-display \fIdisplay\fP] [\-d] [\-\-no\-data] [\-f] [\-\-no\-fonts]
[\-i] [\-\-no\-interface] [\-s] [\-\-no\-splash] [\-\-session \fI<name>\fP]
[\-g] [\-\-gimprc \fI<gimprc>\fP] [\-\-system\-gimprc \fI<gimprc>\fP]
[\-\-dump\-gimprc\fP] [\-\-console\-messages] [\-\-debug\-handlers]
[\-\-stack\-trace\-mode \fI<mode>\fP] [\-\-pdb\-compat\-mode \fI<mode>\fP]
@ -55,10 +55,13 @@ Show all command\-line options.
Show GTK+ command\-line options.
.TP 8
.B \-v, \-\-version
Output the version info.
Output version information and exit.
.TP 8
.B \-\-license
Output license information and exit.
.TP 8
.B \-\-verbose
Show startup messages.
Be verbose and create information on standard output.
.TP 8
.B \-\-no\-shm
Do not use shared memory between GIMP and its plugins.