Package builtins

Class HistoryCommand

java.lang.Object
builtins.HistoryCommand
All Implemented Interfaces:
Command

public class HistoryCommand extends Object implements Command
Implements the 'history' builtin command.
  • Constructor Details

    • HistoryCommand

      public HistoryCommand(List<String> history)
      Constructs a HistoryCommand with the given history list.
      Parameters:
      history - The command history list.
  • Method Details

    • execute

      public Path execute(String[] args, String rawInput, Path currentDirectory)
      Prints the command history.
      Specified by:
      execute in interface Command
      Parameters:
      args - The command and its arguments.
      rawInput - The raw input string.
      currentDirectory - The current working directory.
      Returns:
      The current directory (unchanged).