Add option to set MPD password
authorunknownln <unknownloner.online@gmail.com>
Sat, 18 Feb 2017 16:42:20 +0000 (11:42 -0500)
committerunknownln <unknownloner.online@gmail.com>
Sat, 18 Feb 2017 16:42:20 +0000 (11:42 -0500)
src/ympd.c

index afa25c6..d89f630 100644 (file)
@@ -87,10 +87,11 @@ int main(int argc, char **argv)
         {"user",         required_argument, 0, 'u'},
         {"version",      no_argument,       0, 'v'},
         {"help",         no_argument,       0,  0 },
+        {"mpdpass",      required_argument, 0, 'm'},
         {0,              0,                 0,  0 }
     };
 
-    while((n = getopt_long(argc, argv, "h:p:w:u:v",
+    while((n = getopt_long(argc, argv, "h:p:w:u:v:m",
                 long_options, &option_index)) != -1) {
         switch (n) {
             case 'h':
@@ -105,6 +106,9 @@ int main(int argc, char **argv)
             case 'u':
                 run_as_user = strdup(optarg);
                 break;
+            case 'm':
+                mpd.password = strdup(optarg);
+                break;
             case 'v':
                 fprintf(stdout, "ympd  %d.%d.%d\n"
                         "Copyright (C) 2014 Andrew Karpow <andy@ndyk.de>\n"