--- gvpe/src/gvpe.C 2005/03/18 02:32:20 1.2 +++ gvpe/src/gvpe.C 2005/04/26 00:55:56 1.8 @@ -1,5 +1,5 @@ /* - vped.C -- the main file for gvpe + gvpe.C -- the main file for gvpe Copyright (C) 1998-2002 Ivo Timmermans 2000-2002 Guus Sliepen 2003-2005 Marc Lehmann @@ -18,7 +18,7 @@ You should have received a copy of the GNU General Public License along with gvpe; if not, write to the Free Software - Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "config.h" @@ -104,17 +104,13 @@ int r; int option_index = 0; - while ((r = getopt_long (argc, argv, "-c:DLl:", long_options, &option_index)) != EOF) + while ((r = getopt_long (argc, argv, "c:DLl:", long_options, &option_index)) != EOF) { switch (r) { case 0: /* long option */ break; - case 1: /* this node name */ - thisnode = strdup (optarg); - break; - case 'c': /* config file */ confbase = strdup (optarg); break; @@ -221,6 +217,9 @@ parse_options (argc, argv, envp); + argc -= optind; + argv += optind; + if (show_version) { printf (_("%s version %s (built %s %s, protocol %d.%d)\n"), get_identity (), @@ -249,7 +248,15 @@ slog (L_ERR, _("system call `%s' failed: %s"), "mlockall", strerror (errno)); #endif - conf.read_config (true); + if (argc >= 1) + { + thisnode = *argv++; + argc--; + } + + { + configuration_parser (conf, true, argc, argv); + } set_loglevel (llevel != L_NONE ? llevel : conf.llevel); @@ -257,7 +264,7 @@ if (!THISNODE) { - slog (L_ERR, _("current node not set, or node '%s' not found in configfile, specify the nodename when starting vped."), + slog (L_ERR, _("current node not set, or node '%s' not found in configfile, specify the nodename when starting gvpe."), thisnode ? thisnode : ""); exit (EXIT_FAILURE); }