which
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| MacOSWhichCommand anyenv.os_commands.which macOS which command implementation. |
||
| UnixWhichCommand anyenv.os_commands.which Unix/Linux which command implementation. |
||
| WindowsWhichCommand anyenv.os_commands.which Windows where command implementation. |
🛈 DocStrings¶
Which command implementations for different operating systems.
MacOSWhichCommand
¶
Bases: WhichCommand
macOS which command implementation.
Source code in src/anyenv/os_commands/which.py
create_command
¶
Generate which command (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
executable
|
str
|
Name of executable to find |
required |
Returns:
| Type | Description |
|---|---|
str
|
The which command string |
parse_command
¶
Parse which result (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
str | None
|
Path to executable or None if not found |
Source code in src/anyenv/os_commands/which.py
UnixWhichCommand
¶
Bases: WhichCommand
Unix/Linux which command implementation.
Source code in src/anyenv/os_commands/which.py
create_command
¶
Generate Unix which command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
executable
|
str
|
Name of executable to find |
required |
Returns:
| Type | Description |
|---|---|
str
|
The which command string |
parse_command
¶
Parse Unix which result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
str | None
|
Path to executable or None if not found |
Source code in src/anyenv/os_commands/which.py
WindowsWhichCommand
¶
Bases: WhichCommand
Windows where command implementation.
Source code in src/anyenv/os_commands/which.py
create_command
¶
Generate Windows where command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
executable
|
str
|
Name of executable to find |
required |
Returns:
| Type | Description |
|---|---|
str
|
The where command string |
Source code in src/anyenv/os_commands/which.py
parse_command
¶
Parse Windows where result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
str | None
|
Path to first matching executable or None if not found |