summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Sommerseth <dazo@users.sourceforge.net>2010-12-05 12:04:41 +0100
committerDavid Sommerseth <dazo@users.sourceforge.net>2010-12-05 12:04:41 +0100
commit7a1111e5d72485be53199b19eacb1370d2a0002f (patch)
tree2c4e5f9f476cc91522c2dfbc37a18def7beb1951
parentb23272cf33ac858384e4f970dd214bd3ee79d81b (diff)
downloadeurephia-7a1111e5d72485be53199b19eacb1370d2a0002f.tar.gz
eurephia-7a1111e5d72485be53199b19eacb1370d2a0002f.tar.xz
eurephia-7a1111e5d72485be53199b19eacb1370d2a0002f.zip
eurephiadm config: Inform if the requested config variable is not found
This warning is written to stderr, to avoid breaking scripts which might depend on eurephiadm config's behaviour. Signed-off-by: David Sommerseth <dazo@users.sourceforge.net>
-rw-r--r--eurephiadm/commands/edit_config.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/eurephiadm/commands/edit_config.c b/eurephiadm/commands/edit_config.c
index 7b49235..f827e13 100644
--- a/eurephiadm/commands/edit_config.c
+++ b/eurephiadm/commands/edit_config.c
@@ -138,7 +138,11 @@ int cmd_EditConfig(eurephiaCTX *ctx, eurephiaSESSION *sess, eurephiaVALUES *cfg,
if( argc == 2 ) {
char *val = eGet_value(ctx->dbc->config, argv[1]);
- fprintf(stdout, "%s\n", (val != NULL ? val : ""));
+ if( val ) {
+ fprintf(stdout, "%s\n", val);
+ } else {
+ fprintf(stderr, "(%s is not set)\n", argv[1]);
+ }
rc = 1;
} else if( argc == 1 ){
fprintf(stderr, "No config action performed\n");