X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=client.c;h=f72719f27df46b012165a9e8c8bde3586d602a95;hp=68d8a7efed285891653adfd5d68faaae06d41c1a;hb=7e611b37e41f0ec7ec6d3173b7e88ed5b9b3a276;hpb=8d106ca317a2c42f35a86ba244f843688f6939e6 diff --git a/client.c b/client.c index 68d8a7ef..f72719f2 100644 --- a/client.c +++ b/client.c @@ -1,8 +1,4 @@ -/* - * Copyright (C) 1997 Andre Noll - * - * Licensed under the GPL v2. For licencing details see COPYING. - */ +/* Copyright (C) 1997 Andre Noll , see file COPYING. */ /** \file client.c The client program used to connect to para_server. */ @@ -252,9 +248,15 @@ I9E_DUMMY_COMPLETER(tasks); static struct i9e_completer completers[]; static void help_completer(struct i9e_completion_info *ci, - struct i9e_completion_result *result) + struct i9e_completion_result *cr) { - result->matches = i9e_complete_commands(ci->word, completers); + char *opts[] = {LSG_SERVER_CMD_HELP_OPTS, NULL}; + + if (ci->word[0] == '-') { + i9e_complete_option(opts, ci, cr); + return; + } + cr->matches = i9e_complete_commands(ci->word, completers); } static void stat_completer(struct i9e_completion_info *ci, @@ -497,7 +499,6 @@ static int client_i9e_line_handler(char *line) return 1; } -I9E_DUMMY_COMPLETER(SUPERCOMMAND_UNAVAILABLE); static struct i9e_completer completers[] = { #define LSG_SERVER_CMD_CMD(_name) {.name = #_name, \ .completer = _name ## _completer} @@ -616,13 +617,14 @@ static struct supervisor_task supervisor_task; * * \return EXIT_SUCCESS or EXIT_FAILURE * - * \sa client_open(), stdin.c, stdout.c, para_client(1), para_server(1) + * \sa \ref client_open(), \ref stdin.c, \ref stdout.c, para_client(1), + * para_server(1). */ int main(int argc, char *argv[]) { int ret; - init_random_seed_or_die(); + crypt_init(); sched.default_timeout.tv_sec = 1; ret = client_parse_config(argc, argv, &ct, &client_loglevel); @@ -668,6 +670,7 @@ int main(int argc, char *argv[]) } } sched_shutdown(&sched); + crypt_shutdown(); out: if (ret < 0) PARA_ERROR_LOG("%s\n", para_strerror(-ret));