version 1.5, 2009/07/26 12:58:44 |
version 1.6, 2009/09/21 14:46:47 |
|
|
struct cmd_target_data *data = self->data; |
struct cmd_target_data *data = self->data; |
struct session *s; |
struct session *s; |
struct options *oo; |
struct options *oo; |
|
struct options_entry *o; |
const struct set_option_entry *entry; |
const struct set_option_entry *entry; |
char *vs; |
const char *optval; |
long long vn; |
|
|
|
if (data->chflags & CMD_CHFLAG('g')) |
if (data->chflags & CMD_CHFLAG('g')) |
oo = &global_s_options; |
oo = &global_s_options; |
|
|
} |
} |
|
|
for (entry = set_option_table; entry->name != NULL; entry++) { |
for (entry = set_option_table; entry->name != NULL; entry++) { |
if (options_find1(oo, entry->name) == NULL) |
if ((o = options_find1(oo, entry->name)) == NULL) |
continue; |
continue; |
|
optval = set_option_print(entry, o); |
switch (entry->type) { |
ctx->print(ctx, "%s %s", entry->name, optval); |
case SET_OPTION_STRING: |
|
vs = options_get_string(oo, entry->name); |
|
ctx->print(ctx, "%s \"%s\"", entry->name, vs); |
|
break; |
|
case SET_OPTION_NUMBER: |
|
vn = options_get_number(oo, entry->name); |
|
ctx->print(ctx, "%s %lld", entry->name, vn); |
|
break; |
|
case SET_OPTION_KEY: |
|
vn = options_get_number(oo, entry->name); |
|
ctx->print(ctx, "%s %s", |
|
entry->name, key_string_lookup_key(vn)); |
|
break; |
|
case SET_OPTION_COLOUR: |
|
vn = options_get_number(oo, entry->name); |
|
ctx->print(ctx, "%s %s", |
|
entry->name, colour_tostring(vn)); |
|
break; |
|
case SET_OPTION_ATTRIBUTES: |
|
vn = options_get_number(oo, entry->name); |
|
ctx->print(ctx, "%s %s", |
|
entry->name, attributes_tostring(vn)); |
|
break; |
|
case SET_OPTION_FLAG: |
|
vn = options_get_number(oo, entry->name); |
|
if (vn) |
|
ctx->print(ctx, "%s on", entry->name); |
|
else |
|
ctx->print(ctx, "%s off", entry->name); |
|
break; |
|
case SET_OPTION_CHOICE: |
|
vn = options_get_number(oo, entry->name); |
|
ctx->print(ctx, "%s %s", |
|
entry->name, entry->choices[vn]); |
|
break; |
|
} |
|
} |
} |
|
|
return (0); |
return (0); |