Issue 336 2

These patches consolidate the parse of command line options to ConfigManager.
In addition, it also parses a configuration file.
> Thanks for confirming. Other related codes such as
cmdLineOpts.faceRestPort are also OK?
> For example, faceRestPort is set to 2929 and --face-rest-port=0 is
specified as command line option case.

Thank you for the confirmation
I didn't assume the case --face-rest-port=0. Now the built-in default port
is 0.
So it's unnecessary to use --face-rest-port=0. However, After the
configuration file
have the key to set to the FaceRest port, the value may be different from 0
by
the configuration file. And the command line option: --face-rest-port=0 may
be needed
to overwrite it.

So I'll fix it to accept --face-rest-port=0.

2014-08-12 12:09 GMT+09:00 Kouhei Sutou <notifications@github.com>:

> In server/src/ConfigManager.cc:
>
> > +		if (!succeeded) {
> > +			MLPL_DBG("Failed to load config file: %s (%s)\n",
> > +			         path.c_str(),
> > +			         error ? error->message : "Unknown reason");
> > +			g_error_free(error);
> > +			return false;
> > +		}
> > +
> > +		return true;
> > +	}
> > +
> > +	void reflectCommandLineOptions(const CommandLineOptions &cmdLineOpts)
> > +	{
> > +		if (cmdLineOpts.dbServer)
> > +			parseDBServer(cmdLineOpts.dbServer);
> > +		if (cmdLineOpts.foreground)
>
>  If foreground is true and cmdLineOpts.foreground is false, this code
> doesn't change foreground to false. Is it OK?
> OK. The command line option can set foreground only.
>
>  Thanks for confirming. Other related codes such as
> cmdLineOpts.faceRestPort are also OK?
> For example, faceRestPort is set to 2929 and --face-rest-port=0 is
> specified as command line option case.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/project-hatohol/hatohol/pull/365/files#r16093706>.
>