aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorRaghuram Subramani <raghus2247@gmail.com>2025-07-30 14:01:59 +0530
committerRaghuram Subramani <raghus2247@gmail.com>2025-07-30 14:01:59 +0530
commitf57f335603a13c70168b1f46332a8827c32477b2 (patch)
tree06fe50976f3f72b3bcc063ec8f91156d6c08e003 /src/main.c
parent9aba370924df4c471b8527f08d2c60cacb8989d9 (diff)
msg: get output directory from getopt
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 2977ceb..bfe7473 100644
--- a/src/main.c
+++ b/src/main.c
@@ -39,11 +39,13 @@ main(int argc, char **argv)
{
int opt;
msg = malloc(sizeof(msg_t));
+ msg->base_directory = ".";
+ msg->output_directory = "dist";
while ((opt = getopt(argc, argv, "o:h")) != -1) {
switch (opt) {
case 'o':
- /* msg.output_directory = optarg; */
+ msg->output_directory = optarg;
break;
case 'h':
default:
@@ -52,9 +54,7 @@ main(int argc, char **argv)
}
}
- if (optind == argc)
- msg->base_directory = ".";
- else
+ if (optind < argc)
msg->base_directory = argv[optind];
int r = run();