From: <ni...@us...> - 2008-04-16 11:56:22
|
Revision: 236 http://mspsim.svn.sourceforge.net/mspsim/?rev=236&view=rev Author: nifi Date: 2008-04-16 04:56:14 -0700 (Wed, 16 Apr 2008) Log Message: ----------- fixed the echo command to echo all arguments Modified Paths: -------------- mspsim/se/sics/mspsim/cli/MiscCommands.java Modified: mspsim/se/sics/mspsim/cli/MiscCommands.java =================================================================== --- mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-04-16 11:53:59 UTC (rev 235) +++ mspsim/se/sics/mspsim/cli/MiscCommands.java 2008-04-16 11:56:14 UTC (rev 236) @@ -159,7 +159,12 @@ handler.registerCommand("echo", new BasicCommand("echoes argument", "") { public int executeCommand(CommandContext context) { - context.out.println(context.getArgument(0)); + StringBuilder sb = new StringBuilder(); + for (int i = 0, n = context.getArgumentCount(); i < n; i++) { + if (i > 0) sb.append(' '); + sb.append(context.getArgument(i)); + } + context.out.println(sb.toString()); return 0; } }); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |