+# $mcc->set_debug( true );
+
+function mccShowHelp( $command ) {
+ $commandList = array(
+ 'get' => 'grabs something',
+ 'getsock' => 'lists sockets',
+ 'set' => 'changes something',
+ 'delete' => 'deletes something',
+ 'history' => 'show command line history',
+ 'server' => 'show current memcached server',
+ 'dumpmcc' => 'shows the whole thing',
+ 'exit' => 'exit mcc',
+ 'quit' => 'exit mcc',
+ 'help' => 'help about a command',
+ );
+ if ( !$command ) {
+ $command = 'fullhelp';
+ }
+ if ( $command === 'fullhelp' ) {
+ $max_cmd_len = max( array_map( 'strlen', array_keys( $commandList ) ) );
+ foreach ( $commandList as $cmd => $desc ) {
+ printf( "%-{$max_cmd_len}s: %s\n", $cmd, $desc );
+ }
+ } elseif ( isset( $commandList[$command] ) ) {
+ print "$command: $commandList[$command]\n";
+ } else {
+ print "$command: command does not exist or no help for it\n";
+ }
+}