Just faced a similar problem. I decided it this way, hope it helps a bit.
<script language="C#"><code><![CDATA[ public static void ScriptMain(Project project) { project.Properties["command-line-targets"] = string.Empty; StringBuilder sb = new StringBuilder(); string[] args = Environment.GetCommandLineArgs(); for (int i = 1; i < args.Length; ++i) { string arg = args[i]; if (! arg.StartsWith("-")) { project.Log(Level.Info, " Command line target: " + arg); sb.Append(" ").Append(arg); } } if (sb.Length >= 1) { project.Properties["command-line-targets"] = sb.ToString(1, sb.Length - 1); } } ]]></code></script> <echo message="Command line targets: ${command-line-targets}" />
This code will not show you the default targets.
moudrick
source share