- argv[0] = make_message("%s_recv", r->name);
- conf = r->parse_config(argc, argv);
- for (i = 0; i < argc; i++)
- free(argv[i]);
- free(argv);
- return conf;
-}
-
-/**
- * check if given string is a valid command line for any receiver
- *
- * \param \ra string of the form receiver_name:options
- * \param receiver_num contains the number of the receiver upon success
- *
- * This function checks whether \a ra starts with the name of a supported
- * paraslash receiver, optinally followed by a colon and any options for that
- * receiver. If a valid receiver name was found and further are present, the
- * remaining part of \a ra is passed to that receiver's config parser.
- *
- * \return On success, a pointer to the gengetopt args info struct is returned
- * and \a receiver_num contains the number of the receiver. Otherwise this function
- * returns \p NULL.
- */
-void *check_receiver_arg(char *ra, int *receiver_num)
-{
- int j;
-
- PARA_DEBUG_LOG("checking %s\n", ra);
- for (j = 0; receivers[j].name; j++) {
- const char *name = receivers[j].name;
- size_t len = strlen(name);
- char c;
- if (strlen(ra) < len)
- continue;
- if (strncmp(name, ra, len))
- continue;
- c = ra[len];
- if (c && c != ' ')
- continue;
- if (c && !receivers[j].parse_config)
- return NULL;
- *receiver_num = j;
- return parse_receiver_args(j, c? ra + len + 1: NULL);
+ ret = lls(lls_lookup_subcmd(argv[0], recv_cmd_suite, &errctx));
+ if (ret < 0) {
+ PARA_EMERG_LOG("%s: %s\n", errctx? errctx : argv[0],
+ para_strerror(-ret));
+ exit(EXIT_FAILURE);