From 405854e1e70a22d042cd0e544d1460055b65d57a Mon Sep 17 00:00:00 2001 From: irungentoo Date: Mon, 4 Jan 2016 22:48:58 -0500 Subject: Cleanups. --- .../bootstrap_daemon/src/command_line_arguments.c | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) (limited to 'other/bootstrap_daemon/src/command_line_arguments.c') diff --git a/other/bootstrap_daemon/src/command_line_arguments.c b/other/bootstrap_daemon/src/command_line_arguments.c index 187fa786..ecfef1ad 100644 --- a/other/bootstrap_daemon/src/command_line_arguments.c +++ b/other/bootstrap_daemon/src/command_line_arguments.c @@ -41,26 +41,27 @@ void print_help() // make sure all lines fit into 80 columns // make sure options are listed in alphabetical order write_log(LOG_LEVEL_INFO, - "Usage: tox-bootstrapd [OPTION]... --config=FILE_PATH\n" - "\n" - "Options:\n" - " --config=FILE_PATH Specify path to the config file.\n" - " This is a required option.\n" - " Set FILE_PATH to a path to an empty file in order to\n" - " use default settings.\n" - " --foreground Run the daemon in foreground. The daemon won't fork\n" - " (detach from the terminal) and won't use the PID file.\n" - " --help Print this help message.\n" - " --log-backend=BACKEND Specify which logging backend to use.\n" - " Valid BACKEND values (case sensetive):\n" - " syslog Writes log messages to syslog.\n" - " Default option when no --log-backend is\n" - " specified.\n" - " stdout Writes log messages to stdout/stderr.\n" - " --version Print version information.\n"); + "Usage: tox-bootstrapd [OPTION]... --config=FILE_PATH\n" + "\n" + "Options:\n" + " --config=FILE_PATH Specify path to the config file.\n" + " This is a required option.\n" + " Set FILE_PATH to a path to an empty file in order to\n" + " use default settings.\n" + " --foreground Run the daemon in foreground. The daemon won't fork\n" + " (detach from the terminal) and won't use the PID file.\n" + " --help Print this help message.\n" + " --log-backend=BACKEND Specify which logging backend to use.\n" + " Valid BACKEND values (case sensetive):\n" + " syslog Writes log messages to syslog.\n" + " Default option when no --log-backend is\n" + " specified.\n" + " stdout Writes log messages to stdout/stderr.\n" + " --version Print version information.\n"); } -void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, LOG_BACKEND *log_backend, bool *run_in_foreground) +void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, LOG_BACKEND *log_backend, + bool *run_in_foreground) { if (argc < 2) { write_log(LOG_LEVEL_ERROR, "Error: No arguments provided.\n\n"); @@ -115,6 +116,7 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, print_help(); exit(1); } + break; case 'v': @@ -122,12 +124,12 @@ void handle_command_line_arguments(int argc, char *argv[], char **cfg_file_path, exit(0); case '?': - write_log(LOG_LEVEL_ERROR, "Error: Unrecognized option %s\n\n", argv[optind-1]); + write_log(LOG_LEVEL_ERROR, "Error: Unrecognized option %s\n\n", argv[optind - 1]); print_help(); exit(1); case ':': - write_log(LOG_LEVEL_ERROR, "Error: No argument provided for option %s\n\n", argv[optind-1]); + write_log(LOG_LEVEL_ERROR, "Error: No argument provided for option %s\n\n", argv[optind - 1]); print_help(); exit(1); } -- cgit v1.2.3