- return 1;
- if (is_command ("quit", cmd_str, cmd_len))
- return 0;
- else if (is_command ("set", cmd_str, cmd_len))
- cmd_set (c, r, options, buf);
- else if (is_command ("get", cmd_str, cmd_len))
- cmd_get (c, r, options, buf);
- else if (is_command ("connect", cmd_str, cmd_len))
- cmd_connect (c, r, options, buf);
- else if (is_command ("open", cmd_str, cmd_len))
- cmd_connect (c, r, options, buf);
- else if (is_command ("search", cmd_str, cmd_len))
- cmd_search (c, r, options, buf);
- else if (is_command ("find", cmd_str, cmd_len))
- cmd_search (c, r, options, buf);
- else if (is_command ("show", cmd_str, cmd_len))
- cmd_show (c, r, options, buf);
- else if (is_command ("close", cmd_str, cmd_len))
- cmd_close (c, r, options, buf);
- else if (is_command ("help", cmd_str, cmd_len))
- cmd_help(c, r, options, buf);
- else if (is_command ("ext", cmd_str, cmd_len))
- cmd_ext(c, r, options, buf);
- else if (is_command ("debug", cmd_str, cmd_len))
- cmd_debug(c, r, options, buf);
- else if (is_command ("scan", cmd_str, cmd_len))
- cmd_scan(c, r, options, buf);
- else if (is_command ("sort", cmd_str, cmd_len))
- cmd_sort(c, r, options, buf);
+ return 0;
+ if (is_command("quit", cmd_str, cmd_len))
+ return -1;
+ else if (is_command("set", cmd_str, cmd_len))
+ ret = cmd_set(sh, buf);
+ else if (is_command("get", cmd_str, cmd_len))
+ ret = cmd_get(sh, buf);
+ else if (is_command("rget", cmd_str, cmd_len))
+ ret = cmd_rget(sh, buf);
+ else if (is_command("connect", cmd_str, cmd_len))
+ ret = cmd_connect(sh, buf);
+ else if (is_command("open", cmd_str, cmd_len))
+ ret = cmd_connect(sh, buf);
+ else if (is_command("search", cmd_str, cmd_len))
+ ret = cmd_search(sh, buf);
+ else if (is_command("sortby", cmd_str, cmd_len))
+ ret = cmd_sortby(sh, buf);
+ else if (is_command("facets", cmd_str, cmd_len))
+ ret = cmd_facets(sh, buf);
+ else if (is_command("find", cmd_str, cmd_len))
+ ret = cmd_search(sh, buf);
+ else if (is_command("show", cmd_str, cmd_len))
+ ret = cmd_show(sh, buf);
+ else if (is_command("suggestions", cmd_str, cmd_len))
+ ret = cmd_suggestions(sh, buf);
+ else if (is_command("close", cmd_str, cmd_len))
+ ret = cmd_close(sh, buf);
+ else if (is_command("help", cmd_str, cmd_len))
+ ret = cmd_help(sh, buf);
+ else if (is_command("ext", cmd_str, cmd_len))
+ ret = cmd_ext(sh, buf);
+ else if (is_command("debug", cmd_str, cmd_len))
+ ret = cmd_debug(sh, buf);
+ else if (is_command("scan", cmd_str, cmd_len))
+ ret = cmd_scan(sh, buf);
+ else if (is_command("sort", cmd_str, cmd_len))
+ ret = cmd_sort(sh, buf);
+ else if (is_command("shell", cmd_str, cmd_len))
+ ret = cmd_shell(sh, buf);