Skip Menu |

This queue is for tickets about the CLI-Framework CPAN distribution.

Report information
The Basics
Id: 56887
Status: resolved
Priority: 0/
Queue: CLI-Framework

People
Owner: Nobody in particular
Requestors: ghewson [...] wormhole.me.uk
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.04
Fixed in: (no value)



Subject: Would like to be able to specify the order of menu commands
command_map() returns a hashref, and consequently commands are shown in the menu in the order in which Perl happens to store the keys. I suggest command_map() should instead return an array ref, with the array containing (command, package name) pairs, so the programmer may define the order of the commands. (In fact, I currently define a private method which returns such an array reference. I then override command_map and call the private method from it, and "cast" the array ref to a hash ref. I also override get_interactive_commands and call the same private method, extracting the interactive commands in order.)
On Sat Apr 24 06:30:10 2010, ghewson wrote: Show quoted text
> command_map() returns a hashref, and consequently commands are shown in > the menu in the order in which Perl happens to store the keys. I suggest > command_map() should instead return an array ref, with the array > containing (command, package name) pairs, so the programmer may define > the order of the commands. > > (In fact, I currently define a private method which returns such an > array reference. I then override command_map and call the private method > from it, and "cast" the array ref to a hash ref. I also override > get_interactive_commands and call the same private method, extracting > the interactive commands in order.)
I like this suggestion. At one point, I was planning on having it work that way and I'm not sure at this point why it was changed. In any case, the proper modifications would require a few internal changes and may end up impacting the API a bit, so when I have some time, I'll look into it more closely.
fixed in 0.05