summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c33
1 files 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();
}
-
}