From: Michael Tremer Date: Sun, 28 Sep 2025 09:22:02 +0000 (+0000) Subject: args: Add function to dump the array X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d87a6d0a6283e6419758e42669053d3ed68e9523;p=telemetry.git args: Add function to dump the array Signed-off-by: Michael Tremer --- diff --git a/src/daemon/args.c b/src/daemon/args.c index 7abe62c..64bee44 100644 --- a/src/daemon/args.c +++ b/src/daemon/args.c @@ -122,3 +122,11 @@ ERROR: return -errno; } + +int collecty_args_dump(collecty_args* self) { + for (int i = 0; i < self->argc; i++) { + DEBUG(self->ctx, "argv[%d]: %s\n", i, self->argv[i]); + } + + return 0; +} diff --git a/src/daemon/args.h b/src/daemon/args.h index c523876..13adb30 100644 --- a/src/daemon/args.h +++ b/src/daemon/args.h @@ -36,4 +36,6 @@ int collecty_args_argc(collecty_args* self); int collecty_args_push(collecty_args* self, const char* format, ...) __attribute__((format(printf, 2, 3))); +int collecty_args_dump(collecty_args* self); + #endif /* COLLECTY_ARGS_H */