rapid7/metasploit-framework — pull request #375 by jlee-r7 (2012-05-09 22:52:22+00:00)
Title: Only load commands for meterpreter that make sense for the given session

A few steps to make this work:
* In the various meterpreters:
* Return the list of protocol commands from core_loadlib (thanks mihi for the java implementation)
* In the command dispatchers:
* list protocol commands required for each console command
* Check the requirements against the available protocol commands before enabling the associated console command

Fixes Redmine issue #4905