You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
760 B
33 lines
760 B
package command;
|
|
|
|
import view.ConsoleView;
|
|
import java.util.List;
|
|
import repository.PaperRepository;
|
|
|
|
public class HelpCommand implements Command {
|
|
private ConsoleView view;
|
|
private List<Command> commands;
|
|
|
|
public HelpCommand(ConsoleView view, List<Command> commands) {
|
|
this.view = view;
|
|
this.commands = commands;
|
|
}
|
|
|
|
@Override
|
|
public void execute(String[] args, PaperRepository repository) {
|
|
view.showInfo("可用命令:");
|
|
for (Command command : commands) {
|
|
view.showCommandInfo(command);
|
|
}
|
|
}
|
|
|
|
@Override
|
|
public String getDescription() {
|
|
return "显示帮助信息";
|
|
}
|
|
|
|
@Override
|
|
public String getName() {
|
|
return "help";
|
|
}
|
|
}
|