aboutsummaryrefslogtreecommitdiff
path: root/config-parser.c
diff options
context:
space:
mode:
authorJoel Kronqvist <joelkronqvist@proton.me>2024-04-11 16:17:46 +0300
committerJoel Kronqvist <joelkronqvist@proton.me>2024-04-13 18:31:30 +0300
commitf8f07ca39bd617ddaeb2149f138b12aa7a6532bf (patch)
treea47e8624bad148977b9f6014fcb90641a996c8a8 /config-parser.c
parenta793df3e2a07c65f36fb2f5f43d2c51ab0c47bf2 (diff)
downloadstdu-f8f07ca39bd617ddaeb2149f138b12aa7a6532bf.tar.gz
stdu-f8f07ca39bd617ddaeb2149f138b12aa7a6532bf.zip
Multiline printing & fixes to output space padding
Diffstat (limited to 'config-parser.c')
-rw-r--r--config-parser.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/config-parser.c b/config-parser.c
index 075ef47..3cebc73 100644
--- a/config-parser.c
+++ b/config-parser.c
@@ -1,5 +1,4 @@
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -16,6 +15,7 @@ Result parse_config(int argc, char* argv[]) {
res.success = false;
Config tmp;
tmp.precision = 0;
+ tmp.multiline = false;
tmp.human_readable = false;
tmp.help = false;
@@ -36,6 +36,11 @@ Result parse_config(int argc, char* argv[]) {
) {
tmp.human_readable = true;
} else if (
+ strcmp(argument, "--multiline") == 0
+ || strcmp(argument, "-m") == 0
+ ) {
+ tmp.multiline = true;
+ } else if (
comp1 || strncmp(argument, "-p", 2) == 0
) {
if (precision != NULL) {
@@ -124,6 +129,7 @@ Result parse_config(int argc, char* argv[]) {
Config* conf = malloc(sizeof(int) + sizeof(bool));
conf->help = tmp.help;
conf->human_readable = tmp.human_readable;
+ conf->multiline = tmp.multiline;
conf->precision = tmp.precision;
res.success = true;