]> git.ipfire.org Git - thirdparty/shairport-sync.git/commitdiff
Display command line at the start if debug is enabled.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 14 Oct 2022 09:18:37 +0000 (10:18 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Fri, 14 Oct 2022 09:18:37 +0000 (10:18 +0100)
shairport.c

index 11ffcf6ebe833a1d7df1a986829d4117d92d6ddf..9bc5456a833c082519e5475c3b0a6a807c6344f2 100644 (file)
@@ -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);