summaryrefslogtreecommitdiffstats
path: root/options-cmd.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-01-07 19:53:17 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-01-07 19:53:17 +0000
commit18312fa6fd1b06c68d5f97fd7d1b8830b0d8669f (patch)
tree910b73f9255316238e43e1b4c671b35ff9db042a /options-cmd.c
parent51ca51e329b1ddcbe4a40c76ee5195bd39d34c10 (diff)
Some options tidying/code shrinkage. Also add -u option to unset non-global options (allowing them to inherit), and some extra info.
Diffstat (limited to 'options-cmd.c')
-rw-r--r--options-cmd.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/options-cmd.c b/options-cmd.c
index 6a2e9e58..106def0b 100644
--- a/options-cmd.c
+++ b/options-cmd.c
@@ -1,4 +1,4 @@
-/* $Id: options-cmd.c,v 1.1 2008-12-08 16:19:51 nicm Exp $ */
+/* $Id: options-cmd.c,v 1.2 2009-01-07 19:53:17 nicm Exp $ */
/*
* Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -33,6 +33,7 @@ set_option_string(struct cmd_ctx *ctx, struct options *oo,
}
options_set_string(oo, entry->name, "%s", value);
+ ctx->info(ctx, "set option: %s -> %s", entry->name, value);
}
void
@@ -53,6 +54,7 @@ set_option_number(struct cmd_ctx *ctx, struct options *oo,
return;
}
options_set_number(oo, entry->name, number);
+ ctx->info(ctx, "set option: %s -> %lld", entry->name, number);
}
void
@@ -71,7 +73,8 @@ set_option_key(struct cmd_ctx *ctx, struct options *oo,
return;
}
options_set_number(oo, entry->name, key);
-
+ ctx->info(ctx,
+ "set option: %s -> %s", entry->name, key_string_lookup_key(key));
}
void
@@ -91,6 +94,8 @@ set_option_colour(struct cmd_ctx *ctx, struct options *oo,
}
options_set_number(oo, entry->name, colour);
+ ctx->info(ctx,
+ "set option: %s -> %s", entry->name, colour_tostring(colour));
}
void
@@ -117,6 +122,8 @@ set_option_flag(struct cmd_ctx *ctx, struct options *oo,
}
options_set_number(oo, entry->name, flag);
+ ctx->info(ctx,
+ "set option: %s -> %s", entry->name, flag ? "on" : "off");
}
void
@@ -149,4 +156,6 @@ set_option_choice(struct cmd_ctx *ctx, struct options *oo,
}
options_set_number(oo, entry->name, choice);
+ ctx->info(ctx,
+ "set option: %s -> %s", entry->name, entry->choices[choice]);
}