X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=client.c;h=24f9c61c1c505e304b590b4ad7d7bce7041e13b0;hb=fdd8a22e1df57a8c9254e7d0074301e7dde2c557;hp=2607ee203ee6556a35535f0a293f41dd00203b2e;hpb=80541d0f045e1ed57332800eff9832e0a5b72ddf;p=paraslash.git diff --git a/client.c b/client.c index 2607ee20..24f9c61c 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. */ @@ -104,7 +100,7 @@ static int create_merged_lpr(const char *line) /* * The original lpr for the interactive session has no non-option * arguments. We create a fresh lpr from the words in "line" and merge - * it with the orignal lpr. + * it with the original lpr. */ ret = lls(lls_parse(argc, argv, cmd, &argv_lpr, &errctx)); free_argv(argv); @@ -127,7 +123,7 @@ fail: static int execute_client_command(const char *cmd, char **result) { int ret; - struct sched command_sched = {.default_timeout = {.tv_sec = 1}}; + struct sched command_sched = {.default_timeout = 1000}; struct exec_task exec_task = { .result_buf = para_strdup(""), .result_size = 1, @@ -247,14 +243,19 @@ I9E_DUMMY_COMPLETER(term); I9E_DUMMY_COMPLETER(stop); I9E_DUMMY_COMPLETER(addatt); I9E_DUMMY_COMPLETER(init); -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, @@ -622,8 +623,8 @@ int main(int argc, char *argv[]) { int ret; - init_random_seed_or_die(); - sched.default_timeout.tv_sec = 1; + crypt_init(); + sched.default_timeout = 1000; ret = client_parse_config(argc, argv, &ct, &client_loglevel); if (ret < 0) @@ -668,6 +669,7 @@ int main(int argc, char *argv[]) } } sched_shutdown(&sched); + crypt_shutdown(); out: if (ret < 0) PARA_ERROR_LOG("%s\n", para_strerror(-ret));