Dynamic [Group By] Button

I'm trying to add a button to the Lister Column Header context menu. I want it to perform the [group by] function based on the column that I choose. If I right click on file size, I want it to group by file size. If I right click on Name, I want it to group by name.

I could create a series of buttons for each of the common columns that I use in a lister but this just complicates the context menu.

This is the command (also in the default Lister Column Header menu these days):

SET GROUPBY=%header%,toggle

Thanks, that worked perfectly.

I just searched the v10 reference manual and there is no mention of %header% so at least I don't feel too bad (I did quite a bit of looking). Any reason why it's not there? What other hidden arguments are out there?

It must've been overlooked. I've added it to the manual.