X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=client.c;h=0582edb3a9e1c7beebf52a1d76adab4e6964cb39;hp=987a637fa2301b22beea8795fbe7ee063b46787b;hb=74592ed100009a2d73e03861ae9626363f06aca9;hpb=0879c9de4eaf8c78131c243d8e9fec013df0d14a diff --git a/client.c b/client.c index 987a637f..0582edb3 100644 --- a/client.c +++ b/client.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 1997-2014 Andre Noll + * Copyright (C) 1997 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -22,7 +22,8 @@ #include "error.h" #include "version.h" -INIT_CLIENT_ERRLISTS; +/** Array of error strings. */ +DEFINE_PARA_ERRLIST; static struct sched sched; static struct client_task *ct; @@ -35,8 +36,8 @@ __printf_2_3 void (*para_log)(int, const char*, ...) = stderr_log; #ifdef HAVE_READLINE #include "interactive.h" -#include "server_completion.h" -#include "afs_completion.h" +#include "afs.completion.h" +#include "server_cmd.lsg.h" struct exec_task { struct task *task; @@ -204,10 +205,10 @@ I9E_DUMMY_COMPLETER(pause); I9E_DUMMY_COMPLETER(play); I9E_DUMMY_COMPLETER(si); I9E_DUMMY_COMPLETER(term); -I9E_DUMMY_COMPLETER(version); I9E_DUMMY_COMPLETER(stop); I9E_DUMMY_COMPLETER(addatt); I9E_DUMMY_COMPLETER(init); +I9E_DUMMY_COMPLETER(tasks); static struct i9e_completer completers[]; @@ -217,6 +218,13 @@ static void help_completer(struct i9e_completion_info *ci, result->matches = i9e_complete_commands(ci->word, completers); } +static void version_completer(struct i9e_completion_info *ci, + struct i9e_completion_result *cr) +{ + char *opts[] = {"-v", NULL}; + i9e_complete_option(opts, ci, cr); +} + static void stat_completer(struct i9e_completion_info *ci, struct i9e_completion_result *cr) { @@ -269,9 +277,9 @@ static void ls_completer(struct i9e_completion_info *ci, struct i9e_completion_result *cr) { char *opts[] = { - "--", "-l", "-ls", "-ll", "-lv", "-lp", "-lm", "-lc", "-p", - "-a", "-r", "-d", "-sp", "-sl", "-ss", "-sn", "-sf", "-sc", - "-si", "-sy", "-sb", "-sd", "-sa", NULL + "--", "-l", "-l=s", "-l=l", "-l=v", "-l=p", "-l=m", "-l=c", + "-p", "-a", "-r", "-d", "-s=p", "-s=l", "-s=s", "-s=n", "-s=f", + "-s=c", "-s=i", "-s=y", "-s=b", "-s=d", "-s=a", "-F", "-b", NULL }; if (ci->word[0] == '-') i9e_complete_option(opts, ci, cr); @@ -316,11 +324,7 @@ static void lsatt_completer(struct i9e_completion_info *ci, struct i9e_completion_result *cr) { char *opts[] = {"-i", "-l", "-r", NULL}; - - if (ci->word[0] == '-') - i9e_complete_option(opts, ci, cr); - else - complete_attributes(ci->word, &cr->matches); + i9e_complete_option(opts, ci, cr); } static void mvatt_completer(struct i9e_completion_info *ci, @@ -455,9 +459,13 @@ static int client_i9e_line_handler(char *line) return 1; } +I9E_DUMMY_COMPLETER(SUPERCOMMAND_UNAVAILABLE); static struct i9e_completer completers[] = { - SERVER_COMPLETERS AFS_COMPLETERS +#define LSG_SERVER_CMD_CMD(_name) {.name = #_name, \ + .completer = _name ## _completer} + LSG_SERVER_CMD_COMMANDS +#undef LSG_SERVER_CMD_CMD {.name = NULL} };