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() ) );
Create commands using the introduction when printing help