From 3f35280a364bd35293d3e5804eb2a659a7f174b1 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Mon, 23 Apr 2012 11:11:43 +0530 Subject: cli: implement a fn 'cli_err()' to send error messages to 'stderr' we were using 'cli_out()' to send all the possible msgs, which is not very friendly with scripts, because if one want to get only valid output with " 2>/error.log 1>/proper-info.log" Change-Id: I008ebcbd90935c41dbfc1bd2adeb094ed21116cb Signed-off-by: Amar Tumballi BUG: 815194 Reviewed-on: http://review.gluster.com/3208 Tested-by: Gluster Build System Reviewed-by: Kaushal M Reviewed-by: Vijay Bellur --- cli/src/cli.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'cli/src/cli.h') diff --git a/cli/src/cli.h b/cli/src/cli.h index f0048beae..0b769812c 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -177,10 +177,12 @@ int cli_cmd_process_line (struct cli_state *state, const char *line); int cli_rl_enable (struct cli_state *state); int cli_rl_out (struct cli_state *state, const char *fmt, va_list ap); +int cli_rl_err (struct cli_state *state, const char *fmt, va_list ap); int cli_usage_out (const char *usage); int _cli_out (const char *fmt, ...); +int _cli_err (const char *fmt, ...); #define cli_out(fmt...) do { \ FMT_WARN (fmt); \ @@ -189,6 +191,13 @@ int _cli_out (const char *fmt, ...); \ } while (0) +#define cli_err(fmt...) do { \ + FMT_WARN (fmt); \ + \ + _cli_err(fmt); \ + \ + } while (0) + int cli_submit_request (void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, -- cgit