Context
lib_std.sh already has fatal assertion helpers such as assert_command_exists, but callers sometimes need non-fatal command lookup or function availability checks for library/plugin-style preconditions.
Scope
Add Base-native command/function introspection helpers to lib_std.sh. Do not copy external implementations.
Acceptance Criteria
- Add a non-fatal command path helper using a caller-provided result variable.
- Add
assert_function_exists for required Bash function checks.
- Function checks use Bash-native function introspection such as
declare -F.
- Helpers preserve stdout unless a result output is intentionally requested through a variable.
- Invalid result variable names fail clearly.
- Public API and behavior are documented in
lib/bash/std/README.md.
- BATS coverage verifies commands, builtins or PATH commands as appropriate, existing functions, missing functions, and invalid result names.
Validation
- Focused stdlib BATS coverage.
./tests/validate.sh
- `git diff --check
Context
lib_std.shalready has fatal assertion helpers such asassert_command_exists, but callers sometimes need non-fatal command lookup or function availability checks for library/plugin-style preconditions.Scope
Add Base-native command/function introspection helpers to
lib_std.sh. Do not copy external implementations.Acceptance Criteria
assert_function_existsfor required Bash function checks.declare -F.lib/bash/std/README.md.Validation
./tests/validate.sh