From 62ea56e48aa4026fe7f7f91d528d433220a87be7 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 8 Jan 2023 19:22:07 +0100 Subject: Update code style for main --- main.c | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/main.c b/main.c index 1bde997..88cfec1 100644 --- a/main.c +++ b/main.c @@ -24,21 +24,23 @@ #include "gui.h" -// configuration struct for all command line options +/* + * Configuration struct for all options + */ typedef struct options { bool unknown; bool help; } Options; -// parses all command line arguments. -static void get_opts(Options* opts, int argc, char* argv[]) { - - // initialize Options struct +/* + * Parse command line arguments + */ +static void get_opts(Options* opts, int argc, char* argv[]) +{ opts->unknown = false; opts->help = false; - // parse all arguments to Options struct int c; while ((c=getopt(argc, argv, "h")) != -1) { @@ -52,9 +54,11 @@ static void get_opts(Options* opts, int argc, char* argv[]) { } } -// prints out the help page. -static void print_help(void) { - +/* + * Print help page to command line + */ +static void print_help(void) +{ printf( "The Linux on mobile XMPP (LimoX) client.\n" "\n" @@ -63,20 +67,19 @@ static void print_help(void) { "Options:\n" " -h print help page\n" ); - } -int main(int argc, char* argv[]) { - - // parse command line options +/* + * Run control flow of the application + */ +int main(int argc, char* argv[]) +{ Options opts; get_opts(&opts, argc, argv); - // handle correct use case if (opts.unknown || opts.help) { print_help(); } else { gui_run(); } - } -- cgit v1.2.3-70-g09d2