help.java

来自「用command模式写的一个简单的java 程序」· Java 代码 · 共 36 行

JAVA
36
字号
/*******************************************************************************  Filename    :help.java
*  Description :The help command displays help for FileSystemShell. If the user types*               help [command]*               help invokes that command's help method.
*
*  Author      :xunzy
*
*  History     :2004-02-16   Created******************************************************************************/import java.lang.reflect.Method;import java.io.*;import java.util.Vector;public class help implements Command {    public void execute(File currentDir, Vector args)         throws CommandException {                if (args.isEmpty())            help();        else {            String commandName = (String)args.firstElement();            Command command = FileSystemShell.loadCommand(commandName);            if (command != null)                command.help();            else                 throw new CommandException(new Exception(),                     "No help available for this command");        }    }        public void help() { System.out.print("Usage: help [command]"); }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?