Package builtins

Class PwdCommand

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

public class PwdCommand extends Object implements Command
Implements the 'pwd' (print working directory) builtin command.
  • Constructor Details

    • PwdCommand

      public PwdCommand()
      Constructs a new PwdCommand instance. Initializes the built-in 'pwd' command.
  • Method Details

    • execute

      public Path execute(String[] args, String rawInput, Path currentDirectory)
      Prints the current directory.
      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).