summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/options-table.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-21 16:15:53 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-21 16:15:53 +0000
commit0ae5f147d915b5047a3711e505d37b2771200bba (patch)
treeeea8f8cff54048b754ff02b72b9b2fbc1ca05bd5 /usr.bin/tmux/options-table.c
parent0f6af9b309a721a449999dd82b632cd320d8093b (diff)
Add -v to set and setw to show only option value.
Diffstat (limited to 'usr.bin/tmux/options-table.c')
-rw-r--r--usr.bin/tmux/options-table.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.bin/tmux/options-table.c b/usr.bin/tmux/options-table.c
index b8b1216368d..ae7efd7f5a3 100644
--- a/usr.bin/tmux/options-table.c
+++ b/usr.bin/tmux/options-table.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: options-table.c,v 1.32 2013/01/17 00:11:22 nicm Exp $ */
+/* $OpenBSD: options-table.c,v 1.33 2013/03/21 16:15:52 nicm Exp $ */
/*
* Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -746,8 +746,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;
@@ -755,13 +755,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);