Package builtins

Interface Command

All Known Implementing Classes:
CdCommand, EchoCommand, ExitCommand, ExternalCommand, HistoryCommand, NoOpCommand, PwdCommand, TypeCommand

public interface Command
Interface for all shell commands (builtins and external).
  • Method Summary

    Modifier and Type
    Method
    Description
    execute(String[] args, String rawInput, Path currentDirectory)
    Executes the command and returns the (possibly updated) current directory.
  • Method Details

    • execute

      Path execute(String[] args, String rawInput, Path currentDirectory)
      Executes the command and returns the (possibly updated) current directory.
      Parameters:
      args - The command and its arguments.
      rawInput - The raw input string.
      currentDirectory - The current working directory.
      Returns:
      The updated current directory after execution.