From: <cr...@us...> - 2008-04-25 09:58:58
|
Revision: 4018 http://jnode.svn.sourceforge.net/jnode/?rev=4018&view=rev Author: crawley Date: 2008-04-25 02:58:56 -0700 (Fri, 25 Apr 2008) Log Message: ----------- Converted MemoryCommand Modified Paths: -------------- trunk/shell/descriptors/org.jnode.shell.command.xml trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java Modified: trunk/shell/descriptors/org.jnode.shell.command.xml =================================================================== --- trunk/shell/descriptors/org.jnode.shell.command.xml 2008-04-25 05:56:03 UTC (rev 4017) +++ trunk/shell/descriptors/org.jnode.shell.command.xml 2008-04-25 09:58:56 UTC (rev 4018) @@ -149,8 +149,8 @@ </sequence> </syntax> <syntax alias="loadkeys"> - <empty description="print the current keyboard layout"/> - <sequence description="change the keyboard layout"> + <empty description="Print the current keyboard layout"/> + <sequence description="Change the keyboard layout"> <argument argLabel="country"/> <optional> <argument argLabel="language"/> @@ -161,9 +161,9 @@ </sequence> </syntax> <syntax alias="locale"> - <empty description="print the current default Locale name"/> - <option argLabel="list" longName="list" shortName="l" description="list the names of the available Locales"/> - <sequence description="change the default Locale"> + <empty description="Print the current default Locale name"/> + <option argLabel="list" longName="list" shortName="l" description="List the names of the available Locales"/> + <sequence description="Change the default Locale"> <argument argLabel="language"/> <optional> <argument argLabel="country"/> @@ -173,6 +173,7 @@ </optional> </sequence> </syntax> + <syntax alias="memory" description="Show JNode memory usage"/> <syntax alias="run" description="Run a command file"> <argument argLabel="file"/> </syntax> Modified: trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java =================================================================== --- trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java 2008-04-25 05:56:03 UTC (rev 4017) +++ trunk/shell/src/shell/org/jnode/shell/command/MemoryCommand.java 2008-04-25 09:58:56 UTC (rev 4018) @@ -26,7 +26,6 @@ import org.jnode.shell.AbstractCommand; import org.jnode.shell.CommandLine; -import org.jnode.shell.help.Help; import org.jnode.util.NumberUtils; /** @@ -34,17 +33,19 @@ */ public class MemoryCommand extends AbstractCommand { - - public static Help.Info HELP_INFO = new Help.Info("memory", "View the current memory status"); - public static void main(String[] args) throws Exception { new MemoryCommand().execute(args); } + + public MemoryCommand() { + super("shows current JNode memory usage"); + } - /** + /** * Execute this command */ - public void execute(CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) throws Exception { + public void execute(CommandLine cmdLine, InputStream in, PrintStream out, PrintStream err) + throws Exception { final Runtime rt = Runtime.getRuntime(); out.println("Total memory " + NumberUtils.toBinaryByte(rt.totalMemory())); out.println("Used memory " + NumberUtils.toBinaryByte(rt.totalMemory() - rt.freeMemory())); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |