From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Fri, 14 Oct 2022 09:18:37 +0000 (+0100) Subject: Display command line at the start if debug is enabled. X-Git-Tag: 4.1-rc3~1^2~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abc0e09324b5e0fddc088bc2579673539c3242e2;p=thirdparty%2Fshairport-sync.git Display command line at the start if debug is enabled. --- diff --git a/shairport.c b/shairport.c index 11ffcf6e..9bc5456a 100644 --- a/shairport.c +++ b/shairport.c @@ -2173,6 +2173,24 @@ int main(int argc, char **argv) { } else { debug(1, "can't print the version information!"); } + + // print command line + + if (argc != 0) { + char result[1024]; + char *obfp = result; + int i; + for (i = 0; i < argc - 1; i++) { + snprintf(obfp, strlen(argv[i]) + 2, "%s ", argv[i]); + obfp += strlen(argv[i]) + 1; + } + snprintf(obfp, strlen(argv[i]) + 1, "%s", argv[i]); + obfp += strlen(argv[i]); + *obfp = 0; + debug(1,"Command Line: \"%s\".", result); + } + + debug(1, "log verbosity is %d.", debuglev);