CommandLine: convert pointer to reference
This commit is contained in:
@@ -303,7 +303,7 @@ bool ConfigLoader::TryFile(const AllocatedPath &base_path,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ParseCommandLine(int argc, char **argv, struct options *options)
|
ParseCommandLine(int argc, char **argv, struct options &options)
|
||||||
{
|
{
|
||||||
bool use_config_file = true;
|
bool use_config_file = true;
|
||||||
|
|
||||||
@@ -313,7 +313,7 @@ ParseCommandLine(int argc, char **argv, struct options *options)
|
|||||||
while ((option_index = parser.Next()) >= 0) {
|
while ((option_index = parser.Next()) >= 0) {
|
||||||
switch (Option(option_index)) {
|
switch (Option(option_index)) {
|
||||||
case OPTION_KILL:
|
case OPTION_KILL:
|
||||||
options->kill = true;
|
options.kill = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_NO_CONFIG:
|
case OPTION_NO_CONFIG:
|
||||||
@@ -321,16 +321,16 @@ ParseCommandLine(int argc, char **argv, struct options *options)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_NO_DAEMON:
|
case OPTION_NO_DAEMON:
|
||||||
options->daemon = false;
|
options.daemon = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_STDOUT:
|
case OPTION_STDOUT:
|
||||||
case OPTION_STDERR:
|
case OPTION_STDERR:
|
||||||
options->log_stderr = true;
|
options.log_stderr = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_VERBOSE:
|
case OPTION_VERBOSE:
|
||||||
options->verbose = true;
|
options.verbose = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPTION_VERSION:
|
case OPTION_VERSION:
|
||||||
@@ -344,7 +344,7 @@ ParseCommandLine(int argc, char **argv, struct options *options)
|
|||||||
|
|
||||||
/* initialize the logging library, so the configuration file
|
/* initialize the logging library, so the configuration file
|
||||||
parser can use it already */
|
parser can use it already */
|
||||||
log_early_init(options->verbose);
|
log_early_init(options.verbose);
|
||||||
|
|
||||||
if (!use_config_file) {
|
if (!use_config_file) {
|
||||||
LogDebug(cmdline_domain,
|
LogDebug(cmdline_domain,
|
||||||
|
@@ -28,6 +28,6 @@ struct options {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
ParseCommandLine(int argc, char **argv, struct options *options);
|
ParseCommandLine(int argc, char **argv, struct options &options);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -469,7 +469,7 @@ try {
|
|||||||
ReadConfigFile(config_path);
|
ReadConfigFile(config_path);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
ParseCommandLine(argc, argv, &options);
|
ParseCommandLine(argc, argv, options);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const auto config = LoadConfig();
|
const auto config = LoadConfig();
|
||||||
|
Reference in New Issue
Block a user