Skip to content

Add downstream version requirement helper #68

@codeforester

Description

@codeforester

Summary

Add a Base-native helper that lets downstream scripts require a minimum base-bash-libs version at runtime.

Rationale

The library already exposes BASE_BASH_LIBS_VERSION; consumers also need a small, documented way to fail clearly when a script depends on newer public APIs. This borrows the concept of explicit minimum-version checks from external Bash stdlib designs without copying their implementation.

Proposed Scope

  • Add a public helper in lib/bash/std/lib_std.sh, such as base_bash_libs_require_version <minimum_version>.
  • Compare semantic-ish dotted versions without depending on external commands.
  • Emit a clear fatal error when the loaded library is too old.
  • Document the helper in the std README and top-level usage examples.
  • Add focused BATS coverage for equal, newer, older, and invalid version inputs.

Acceptance Criteria

  • Downstream scripts can check a minimum supported base-bash-libs version after sourcing lib_std.sh.
  • Invalid or unsupported version strings fail clearly.
  • ./tests/validate.sh passes.

Notes

Concept source: comparison with srcshelton/stdlib.sh; write fresh Base-style code under this repo's standards.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or product improvement

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions