int out_fd = STDOUT_FILENO;
bool result = false;
- while ((opt = getopt(argc, argv, "o:")) != -1) {
+ while ((opt = getopt(argc, argv, "+o:")) != -1) {
switch(opt) {
case 'o':
filename = optarg;
int i = optind;
const char *service_name = argv[i];
+ int arg_offset = 1;
+
+ /*
+ * If the service name is followed by "--", we do not send it as argument.
+ */
+ if (optind + 1 < argc && strncmp(argv[optind + 1], "--", 3) == 0)
+ arg_offset += 1;
+
int in_fd;
- if (dumpsys_dump(service_name, argc-i-1, (const char **)&argv[i+1], &in_fd) == TIZEN_ERROR_NONE)
+ if (dumpsys_dump(service_name, argc-i-arg_offset, (const char **)&argv[i+arg_offset], &in_fd) == TIZEN_ERROR_NONE)
result = copy_data(out_fd, in_fd);
end: