mirror of
https://github.com/tmux/tmux.git
synced 2024-11-19 10:58:51 +00:00
Add -v to set and setw to show only option value.
This commit is contained in:
parent
63b4fd5cac
commit
69fe5ca567
@ -746,8 +746,8 @@ options_table_populate_tree(
|
|||||||
|
|
||||||
/* Print an option using its type from the table. */
|
/* Print an option using its type from the table. */
|
||||||
const char *
|
const char *
|
||||||
options_table_print_entry(
|
options_table_print_entry(const struct options_table_entry *oe,
|
||||||
const struct options_table_entry *oe, struct options_entry *o)
|
struct options_entry *o, int no_quotes)
|
||||||
{
|
{
|
||||||
static char out[BUFSIZ];
|
static char out[BUFSIZ];
|
||||||
const char *s;
|
const char *s;
|
||||||
@ -755,13 +755,17 @@ options_table_print_entry(
|
|||||||
*out = '\0';
|
*out = '\0';
|
||||||
switch (oe->type) {
|
switch (oe->type) {
|
||||||
case OPTIONS_TABLE_STRING:
|
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;
|
break;
|
||||||
case OPTIONS_TABLE_NUMBER:
|
case OPTIONS_TABLE_NUMBER:
|
||||||
xsnprintf(out, sizeof out, "%lld", o->num);
|
xsnprintf(out, sizeof out, "%lld", o->num);
|
||||||
break;
|
break;
|
||||||
case OPTIONS_TABLE_KEY:
|
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;
|
break;
|
||||||
case OPTIONS_TABLE_COLOUR:
|
case OPTIONS_TABLE_COLOUR:
|
||||||
s = colour_tostring(o->num);
|
s = colour_tostring(o->num);
|
||||||
|
Loading…
Reference in New Issue
Block a user