Hi,

On 22 March 2012 11:14, Nicholas Marriott <nicholas.marri...@gmail.com> wrote:
> Hi
>
> I tweaked this a bit so the output format is the same for one or many
> variables and applied it, thanks!

Sorry to bring this up now after this patch has gone out, but I'm
curious to know if the following patch isn't more preferred when
"show-options" is given a key to look up the value for?

diff --git a/trunk/cmd-show-options.c b/trunk/cmd-show-options.c
index 3abb564..9027d90 100644
--- a/trunk/cmd-show-options.c
+++ b/trunk/cmd-show-options.c
@@ -99,7 +99,7 @@ cmd_show_options_exec(struct cmd *self, struct cmd_ctx *ctx)
                if ((o = options_find1(oo, oe->name)) == NULL)
                        return (0);
                optval = options_table_print_entry(oe, o);
-               ctx->print(ctx, "%s %s", oe->name, optval);
+               ctx->print(ctx, "%s" optval);
        } else {
                for (oe = table; oe->name != NULL; oe++) {
                        if ((o = options_find1(oo, oe->name)) == NULL)

The idea being that if I've given an option to show-options I already
know what the key is -- I care more for finding out its *value*.
Currently I would have to do this:

tmux show-options -g status | awk '{print $2}'

Which, for other things, I can already do the whole awk thing, just by
using show-options without any parameters.

Just a thought... One guy was alluding to this on IRC earlier.

Kindly,

-- Thomas Adam

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
tmux-users mailing list
tmux-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tmux-users

Reply via email to