JustBash.Commands.Command behaviour (JustBash v0.3.0)
View SourceBehaviour for bash commands.
Each command module implements this behaviour, providing a consistent interface for command execution.
Summary
Callbacks
Execute the command with the given arguments and stdin.
Returns the command name(s) this module handles.
Functions
Create a failed result with stderr output.
Create a successful result with stdout output.
Resolve a path relative to the current working directory.
Create a result with custom stdout, stderr, and exit code.
Types
Callbacks
@callback execute(bash(), args :: [String.t()], stdin :: String.t()) :: execution_result()
Execute the command with the given arguments and stdin.
@callback names() :: [String.t()]
Returns the command name(s) this module handles.
Functions
@spec error(String.t(), non_neg_integer()) :: result()
Create a failed result with stderr output.
Create a successful result with stdout output.
Resolve a path relative to the current working directory.
@spec result(String.t(), String.t(), non_neg_integer()) :: result()
Create a result with custom stdout, stderr, and exit code.