Skip to content

PwdCommand

Sub classes

Name Children Inherits
UnixPwdCommand
anyenv.os_commands.pwd
Unix/Linux pwd command implementation.
    MacOSPwdCommand
    anyenv.os_commands.pwd
    macOS pwd command implementation.
      WindowsPwdCommand
      anyenv.os_commands.pwd
      Windows pwd command implementation.

        Base classes

        Name Children Inherits
        ABC
        abc
        Helper class that provides a standard way to create an ABC using

        ⋔ Inheritance diagram

        graph TD
          2510224188["base.PwdCommand"]
          925645236["abc.ABC"]
          2751680898["builtins.object"]
          925645236 --> 2510224188
          2751680898 --> 925645236

        🛈 DocStrings

        Bases: ABC

        Base class for pwd (print working directory) commands.

        Source code in src/anyenv/os_commands/base.py
        class PwdCommand(ABC):
            """Base class for pwd (print working directory) commands."""
        
            @abstractmethod
            def create_command(self) -> str:
                """Generate command to get current working directory."""
        
            @abstractmethod
            def parse_command(self, output: str, exit_code: int = 0) -> str | None:
                """Parse output and return current directory or None on failure."""
        

        create_command abstractmethod

        create_command() -> str
        

        Generate command to get current working directory.

        Source code in src/anyenv/os_commands/base.py
        @abstractmethod
        def create_command(self) -> str:
            """Generate command to get current working directory."""
        

        parse_command abstractmethod

        parse_command(output: str, exit_code: int = 0) -> str | None
        

        Parse output and return current directory or None on failure.

        Source code in src/anyenv/os_commands/base.py
        @abstractmethod
        def parse_command(self, output: str, exit_code: int = 0) -> str | None:
            """Parse output and return current directory or None on failure."""
        

        :fa-brands-github: Show source on GitHub