aboutsummaryrefslogtreecommitdiff
path: root/options-table.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2013-02-12 20:12:10 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2013-02-12 20:12:10 +0000
commit102cb7743545a1d86c53e7958fc56ec599ba0cd7 (patch)
tree5c349ff6a331dc3647b24216fb4bd2ca3e076dfa /options-table.c
parent7360ff4496bfd159ac5935a18de675f067c375db (diff)
downloadrtmux-102cb7743545a1d86c53e7958fc56ec599ba0cd7.tar.gz
rtmux-102cb7743545a1d86c53e7958fc56ec599ba0cd7.tar.bz2
rtmux-102cb7743545a1d86c53e7958fc56ec599ba0cd7.zip
Add -v to set and setw to show only option value.
Diffstat (limited to 'options-table.c')
-rw-r--r--options-table.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/options-table.c b/options-table.c
index 83ec97f2..37b3b100 100644
--- a/options-table.c
+++ b/options-table.c
@@ -745,8 +745,8 @@ options_table_populate_tree(
/* Print an option using its type from the table. */
const char *
-options_table_print_entry(
- const struct options_table_entry *oe, struct options_entry *o)
+options_table_print_entry(const struct options_table_entry *oe,
+ struct options_entry *o, int no_quotes)
{
static char out[BUFSIZ];
const char *s;
@@ -754,13 +754,17 @@ options_table_print_entry(
*out = '\0';
switch (oe->type) {
case OPTIONS_TABLE_STRING:
- xsnprintf(out, sizeof out, "\"%s\"", o->str);
+ if (no_quotes)
+ xsnprintf(out, sizeof out, "%s", o->str);
+ else
+ xsnprintf(out, sizeof out, "\"%s\"", o->str);
break;
case OPTIONS_TABLE_NUMBER:
xsnprintf(out, sizeof out, "%lld", o->num);
break;
case OPTIONS_TABLE_KEY:
- xsnprintf(out, sizeof out, "%s", key_string_lookup_key(o->num));
+ xsnprintf(out, sizeof out, "%s",
+ key_string_lookup_key(o->num));
break;
case OPTIONS_TABLE_COLOUR:
s = colour_tostring(o->num);