+ char *p;
+
+ parse_args_only(cmd, args, argc, argk, argv, max_args);
+
+ /* Separate keyword and value */
+ for (int i=0; i < *argc; i++) {
+ p = strchr(argk[i], '=');
+ if (p) {
+ *p++ = 0; /* terminate keyword and point to value */
+ }
+ argv[i] = p; /* save ptr to value or NULL */
+ }
+#ifdef xxx_debug
+ for (int i=0; i < *argc; i++) {
+ Pmsg3(000, "Arg %d: kw=%s val=%s\n", i, argk[i], argv[i]?argv[i]:"NULL");
+ }
+#endif
+ return 1;
+}
+
+
+/*
+ * This routine parses the input command line.
+ * It makes a copy in args, then builds an
+ * argc, argk, but no argv (values).
+ * This routine is useful for scanning command lines where the data
+ * is a filename and no keywords are expected. If we scan a filename
+ * for keywords, any = in the filename will be interpreted as the
+ * end of a keyword, and this is not good.
+ *
+ * argc = count of arguments
+ * argk[i] = argument keyword (part preceding =)
+ * argv[i] = NULL
+ *
+ * example: arg1 arg2=abc arg3=
+ *
+ * argc = c
+ * argk[0] = arg1
+ * argv[0] = NULL
+ * argk[1] = arg2=abc
+ * argv[1] = NULL
+ * argk[2] = arg3
+ * argv[2] =
+ */
+int parse_args_only(POOLMEM *cmd, POOLMEM **args, int *argc,
+ char **argk, char **argv, int max_args)
+{
+ char *p, *n;