Commands.this

Create commands using the introduction when printing help

struct Commands(COMMAND)
this
()

Examples

auto cmds = Commands!( string delegate( string ) )( "Usage: myprogram [OPTION]" );

cmds.add( "world", delegate( string parameter ) { return parameter ~ " world"; }, 
		"Append world to the given parameter" );
cmds.add( "help", delegate( string parameter ) { cmds.toString; return parameter; }, 
		"Print this help message." );
assert( cmds["world"]( "Hello" ) == "Hello world" );
assert( equal( ["world", "help"], cmds.commands() ) );

Meta