env_var
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| MacOSEnvVarCommand anyenv.os_commands.env_var macOS environment variable command implementation. |
||
| UnixEnvVarCommand anyenv.os_commands.env_var Unix/Linux environment variable command implementation. |
||
| WindowsEnvVarCommand anyenv.os_commands.env_var Windows environment variable command implementation. |
🛈 DocStrings¶
Environment variable command implementations for different operating systems.
MacOSEnvVarCommand
¶
Bases: EnvVarCommand
macOS environment variable command implementation.
Source code in src/anyenv/os_commands/env_var.py
create_command
¶
Generate printenv command (same as Unix).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of environment variable |
required |
Returns:
| Type | Description |
|---|---|
str
|
The printenv command string |
parse_command
¶
Parse printenv 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
|
Variable value or None if not set |
Source code in src/anyenv/os_commands/env_var.py
UnixEnvVarCommand
¶
Bases: EnvVarCommand
Unix/Linux environment variable command implementation.
Source code in src/anyenv/os_commands/env_var.py
create_command
¶
Generate Unix printenv command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of environment variable |
required |
Returns:
| Type | Description |
|---|---|
str
|
The printenv command string |
parse_command
¶
Parse Unix printenv result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
str | None
|
Variable value or None if not set |
Source code in src/anyenv/os_commands/env_var.py
WindowsEnvVarCommand
¶
Bases: EnvVarCommand
Windows environment variable command implementation.
Source code in src/anyenv/os_commands/env_var.py
create_command
¶
Generate PowerShell environment variable command.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Name of environment variable |
required |
Returns:
| Type | Description |
|---|---|
str
|
The PowerShell command string |
Source code in src/anyenv/os_commands/env_var.py
parse_command
¶
Parse PowerShell environment variable result.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output
|
str
|
Raw command output |
required |
exit_code
|
int
|
Command exit code |
0
|
Returns:
| Type | Description |
|---|---|
str | None
|
Variable value or None if not set |