1 |
/* |
/* |
2 |
** Beaver's an Early AdVanced EditoR |
** Beaver's an Early AdVanced EditoR |
3 |
** (C) 1999-2000 Marc Bevand, Damien Terrier and Emmanuel Turquin |
** (C) 1999-2000 Marc Bevand, Damien Terrier and Emmanuel Turquin |
4 |
|
** (C) 200 |
5 |
** |
** |
6 |
** main.c |
** main.c |
7 |
** |
** |
8 |
** Author<s>: Emmanuel Turquin (aka "Ender") <turqui_e@epita.fr> |
** Author<s>: Leslie Polzer <leslie.polzer@gmx.net> |
9 |
** Latest update: Wed Jan 10 20:32:23 2001 |
** Emmanuel Turquin (aka "Ender") <turqui_e@epita.fr> |
10 |
** Description: Beaver main source file |
** Description: Beaver main source file |
11 |
** |
** |
12 |
** This program is free software; you can redistribute it and/or modify |
** This program is free software; you can redistribute it and/or modify |
33 |
#include "main.h" |
#include "main.h" |
34 |
|
|
35 |
|
|
|
/* The incredibly complex 'main' function :) */ |
|
36 |
|
|
37 |
int main (int argc, char *argv[]) |
int main (int argc, char *argv[]) |
38 |
{ |
{ |
50 |
|
|
51 |
for (i = 1; i < argc; i++) |
for (i = 1; i < argc; i++) |
52 |
{ |
{ |
53 |
if (!strcmp (argv[i], "--help") || !strcmp (argv[i], "-?")) |
if (!strcmp (argv[i], "--help") || !strcmp (argv[i], "-h")) |
54 |
{ |
{ |
55 |
g_print |
print_usage(argv[0]); |
56 |
(g_strconcat |
return(1); |
|
(_("Usage: "), PACKAGE, " [", _("OPTION"), "...] [", _("FILE"), "...]", |
|
|
"\n\n", |
|
|
_("Help options"), "\n", |
|
|
" -?, --help\t\t\t", _("Show this help message"), "\n", |
|
|
" --usage\t\t\t", _("Display brief usage message"), |
|
|
"\n\n", |
|
|
_("GTK/X options"), "\n", |
|
|
" --gdk-debug=FLAGS\t\t", _("Gdk debugging flags to set"), "\n", |
|
|
" --gdk-no-debug=FLAGS\t\t", _("Gdk debugging flags to unset"), "\n", |
|
|
" --display=DISPLAY\t\t", _("X display to use"), "\n", |
|
|
" --sync\t\t\t", _("Make X calls synchronous"), "\n", |
|
|
" --no-xshm\t\t\t", _("Don't use X shared memory extension"), "\n", |
|
|
" --name=NAME\t\t\t", _("Program name as used by the window manager"), "\n", |
|
|
" --class=CLASS\t\t\t", _("Program class as used by the window manager"), "\n", |
|
|
" --gtk-debug=FLAGS\t\t", _("Gtk+ debugging flags to set"), "\n", |
|
|
" --gtk-no-debug=FLAGS\t\t", _("Gtk+ debugging flags to unset"), "\n", |
|
|
" --g-fatal-warnings\t\t", _("Make all warnings fatal"), "\n", |
|
|
" --gtk-module=MODULE\t\t", _("Load an additional Gtk module"), |
|
|
"\n\n", |
|
|
_("Misc. options"), "\n", |
|
|
" --version\t\t\t", _("Display version number"), "\n", NULL)); |
|
|
return(1); |
|
|
} |
|
|
else if (!strcmp (argv[i], "--usage")) |
|
|
{ |
|
|
g_print |
|
|
(g_strconcat |
|
|
(_("Usage: "), PACKAGE, " [-?] [--version] [--usage] " |
|
|
"[--gdk-debug=FLAGS]\n\t[--gdk-no-debug=FLAGS] " |
|
|
"[--display=DISPLAY] [--sync] [--no-xshm]\n\t" |
|
|
"[--name=NAME] [--class=CLASS] [--gtk-debug=FLAGS] " |
|
|
"[--gtk-no-debug=FLAGS]\n\t[--g-fatal-warnings] " |
|
|
"[--gtk-module=MODULE]\n", NULL)); |
|
|
return (1); |
|
57 |
} |
} |
58 |
else if (!strcmp (argv[i], "--version")) |
else if (!strcmp (argv[i], "--version")) |
59 |
{ |
{ |
70 |
mkdir (ConfDir, 0755); |
mkdir (ConfDir, 0755); |
71 |
g_free (ConfDir); |
g_free (ConfDir); |
72 |
interface (argc, argv); |
interface (argc, argv); |
73 |
|
|
74 |
return (0); |
return (0); |
75 |
} |
} |
76 |
|
|
77 |
|
|
78 |
|
void print_usage(char *command) |
79 |
|
{ |
80 |
|
g_print(g_strconcat( |
81 |
|
|
82 |
|
_("Usage: "), command, " [", _("OPTION"), "...] [", _("FILE"), " ...]", "\n", |
83 |
|
_("Beaver"), " ", PACKAGE_VERSION, |
84 |
|
" compiled by ", COMPILE_USER, "@", COMPILE_HOST, |
85 |
|
" on ", COMPILE_TIME, "\n", |
86 |
|
"\n", |
87 |
|
" -h, --help\t\t\t", _("Show this help message"), "\n", |
88 |
|
" --version\t\t\t", _("Display version number"), "\n", |
89 |
|
"\n", |
90 |
|
_("Report bugs to"), " ", PACKAGE_BUGREPORT, "\n", |
91 |
|
"\n", |
92 |
|
|
93 |
|
NULL)); |
94 |
|
|
95 |
|
return; |
96 |
|
} |