From 86c818a98a18a3b6c33a494202922f1cd275ac7b Mon Sep 17 00:00:00 2001 From: Csaba Henk Date: Wed, 11 May 2011 02:39:14 +0000 Subject: cli: taking my revenge for forcing "geo-replication" into commandline Accept unambigous initial fragments of keywords, eg. gluster vol geo stat is recognized. Compared to readline integration: - no external dependency - works in shell too - works for inner keywords of operations (as in above example, or "vol crea repl 3 ...") - you save pressing tabs :) If not desired in customer builds, can be disabled by an #ifdef (not integrated into build system as of now); however, I think folks in house could like it. Signed-off-by: Csaba Henk Signed-off-by: Anand Avati BUG: 2757 (refactory gsync/gsyncd/syncdaemon/whatever to geo-replication) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2757 --- cli/src/cli.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli/src/cli.h') diff --git a/cli/src/cli.h b/cli/src/cli.h index 70d6cfb27..5d83f0fc1 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -150,6 +150,10 @@ typedef ssize_t (*cli_serialize_t) (struct iovec outmsg, void *args); extern struct cli_state *global_state; /* use only in readline callback */ +typedef const char *(*cli_selector_t) (void *wcon); + +void *cli_getunamb (const char *tok, void **choices, cli_selector_t sel); + int cli_cmd_register (struct cli_cmd_tree *tree, struct cli_cmd *cmd); int cli_cmds_register (struct cli_state *state); -- cgit