bashdeps
Exact dependency materialization and manifest maintenance tools
Loading...
Searching...
No Matches
Functions | Variables
manifest-manager.bash File Reference

Maintains and inspects bashdeps manifests through deliberate commands. More...

Functions

int __manifest_manager_usage ()
 Writes the complete currently supported manager CLI surface to STDOUT.
 
int __manifest_manager_update_usage ()
 Writes complete public help for the update subcommand.
 
int __manifest_manager_version_output ()
 Writes manager identity and shared release metadata to STDOUT.
 
int __manifest_manager_update_has_help (String args)
 Tests whether update arguments request informational help output.
 
int __manifest_manager_update_has_version (String args)
 Tests whether update arguments request informational version output.
 
int __manifest_manager_update_has_stream_hint (String args)
 Detects whether raw update arguments unambiguously request filename -.
 
int __manifest_manager_run_update (String args)
 Executes one complete update invocation including transactional I/O.
 
int __manifest_manager_main (String args)
 Dispatches the public manifest-manager command-line interface.
 

Variables

String __manifest_manager_version
 Shared bashdeps project version reported by the manager executable.
 
String __manifest_manager_build_date
 Source revision date injected into generated manager artifacts.
 
String __manifest_manager_build_commit
 Source commit identifier injected into generated manager artifacts.
 

Detailed Description

Maintains and inspects bashdeps manifests through deliberate commands.

manifest-manager.bash is a maintainer-side companion to bashdeps.bash. It prepares deliberate source changes to dependency declarations and provides validated read-only inspection without participating in runtime artifact synchronization.

The executable is intentionally separate from the bashdeps synchronization runtime. It may discover GitHub's latest release and calculate proposed trust data for update, while add requires complete declaration data from the caller and remove deletes one exact selected record. bashdeps.bash continues to consume only already-reviewed manifest declarations. The list command reads validated complete identity values without reserializing manifest source.

Maintained source loads manager-only implementation modules from lib/manifest-manager/. Release assembly incorporates that explicit source closure into each generated manager artifact and removes the repository-only import block. No manager module is incorporated into bashdeps.bash.

Note
The public interface is this executable CLI. Private functions beginning with __manifest_manager_ are not a supported sourceable API.
Warning
Successful mutations propose new trusted manifest source. Review and commit of those source changes remain the authorization boundary.
See also
doc/manifest-manager-spec.md
doc/adr/ADR-020-ship-manifest-manager-and-define-surgical-updates.md
doc/adr/ADR-021-extend-manifest-manager-with-list-add-and-remove.md
Examples
manifest-manager.bash list
manifest-manager.bash add id=acme/tool@v1 \
url=https://example.test/tool dest=vendor/tool \
digest=sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
manifest-manager.bash remove acme/tool@v1
manifest-manager.bash update wesley-dean/bash-doxygen

Function Documentation

◆ __manifest_manager_main()

int __manifest_manager_main ( String  args)

Dispatches the public manifest-manager command-line interface.

Top-level help/version forms succeed without manifest input. update, add, and remove delegate to transactional mutation runners, while list delegates to its read-only validated identity runner. Unknown or missing commands fail with status 2 and a concise diagnostic.

Parameters
argsPublic command arguments excluding the executable name.
STDIN
Depends on the selected command; mutating -f - forms and list -f - consume a manifest stream.
STDOUT
Help/version text, list output, or a transactional manifest stream when selected.
STDERR
A diagnostic is written for unknown or missing commands and operational errors.
Returns
Command-specific public output.
Return values
0The selected command succeeded.
2The public command name or invocation was invalid.
Note
Other documented public command statuses from 3 through 6 are propagated when relevant.
Examples
__manifest_manager_main add id=tool@1 url=https://example.test/tool \
dest=vendor/tool digest=sha256:0123...
__manifest_manager_main update owner/repo v1.2.3
int __manifest_manager_main(String args)
Dispatches the public manifest-manager command-line interface.

◆ __manifest_manager_run_update()

int __manifest_manager_run_update ( String  args)

Executes one complete update invocation including transactional I/O.

Informational options are handled without staging. For stream mode, complete STDIN capture occurs before full CLI parsing so recognized stream invocations can reproduce original input even when argument validation later fails. File mode captures the selected manifest only after CLI parsing. All network and mutation work operates on that captured original, followed by exactly one stream emission or one staged file publication.

Parameters
argsArguments following the public update subcommand.
STDIN
The complete manifest only when -f - stream mode is selected.
STDOUT
Help/version text, a complete transactional manifest in stream mode, or nothing for ordinary successful file-mode operation.
STDERR
Diagnostics are written for invalid requests and failed update operations.
Returns
Informational text, a stream manifest, or no data by mode.
Return values
0The operation succeeded or was a successful no-op.
2The CLI, manifest, selection, or declaration was invalid.
3A required runtime capability was unavailable.
4Release discovery or network acquisition failed.
5Surgical or preservation safety validation failed.
6Input, staging, filesystem, output, or publication failed.
Examples
int __manifest_manager_run_update(String args)
Executes one complete update invocation including transactional I/O.

◆ __manifest_manager_update_has_help()

int __manifest_manager_update_has_help ( String  args)

Tests whether update arguments request informational help output.

This compatibility-local wrapper delegates to the shared command pre-scan so update behavior remains unchanged while other commands use the same informational-option rule.

Parameters
argsArguments following the update subcommand.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Nothing is written to STDERR.
Returns
Nothing is written to STDOUT.
Return values
0At least one -h or --help argument is present.
1No update help option is present.
Examples
int __manifest_manager_update_has_help(String args)
Tests whether update arguments request informational help output.

◆ __manifest_manager_update_has_stream_hint()

int __manifest_manager_update_has_stream_hint ( String  args)

Detects whether raw update arguments unambiguously request filename -.

The wrapper retains the existing update runner contract while sharing stream filename recognition with other manager commands.

Parameters
argsArguments following the update subcommand.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Nothing is written to STDERR.
Returns
Nothing is written to STDOUT.
Return values
0A recognizable stream filename request is present.
1No recognizable stream filename request is present.
Examples
int __manifest_manager_update_has_stream_hint(String args)
Detects whether raw update arguments unambiguously request filename -.

◆ __manifest_manager_update_has_version()

int __manifest_manager_update_has_version ( String  args)

Tests whether update arguments request informational version output.

This wrapper preserves the established update call structure while delegating detection to the command-agnostic helper introduced for the expanded CLI.

Parameters
argsArguments following the update subcommand.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Nothing is written to STDERR.
Returns
Nothing is written to STDOUT.
Return values
0At least one -V or --version argument is present.
1No update version option is present.
Examples
int __manifest_manager_update_has_version(String args)
Tests whether update arguments request informational version output.

◆ __manifest_manager_update_usage()

int __manifest_manager_update_usage ( )

Writes complete public help for the update subcommand.

Update help documents positional forms, option meanings, omitted-version behavior, transactional stream rollback, and relevant public exit categories.

STDIN
Nothing is read from STDIN.
STDOUT
Human-readable update help is written.
STDERR
Nothing is intentionally written to STDERR.
Returns
Multi-line human-readable help text.
Return values
0Help text was written successfully.
Note
A non-zero output status may be propagated if STDOUT cannot be written.
Examples
int __manifest_manager_update_usage()
Writes complete public help for the update subcommand.

◆ __manifest_manager_usage()

int __manifest_manager_usage ( )

Writes the complete currently supported manager CLI surface to STDOUT.

Top-level help summarizes the implemented update, list, add, and remove commands and directs callers to command-specific help for operation details.

STDIN
Nothing is read from STDIN.
STDOUT
Human-readable public CLI help is written.
STDERR
Nothing is intentionally written to STDERR.
Returns
Multi-line human-readable help text.
Return values
0Help text was written successfully.
Note
A non-zero output status may be propagated if STDOUT cannot be written.
Examples
int __manifest_manager_usage()
Writes the complete currently supported manager CLI surface to STDOUT.

◆ __manifest_manager_version_output()

int __manifest_manager_version_output ( )

Writes manager identity and shared release metadata to STDOUT.

Both bashdeps repository executables share one project version, source revision date, and source commit for a release. The first line identifies this product specifically as manifest-manager.bash.

STDIN
Nothing is read from STDIN.
STDOUT
Executable name/version followed by build date and commit metadata is written.
STDERR
Nothing is intentionally written to STDERR.
Returns
Three newline-delimited version/build metadata lines.
Return values
0Version metadata was written successfully.
Note
A non-zero printf status may be propagated if STDOUT cannot be written.
Examples
int __manifest_manager_version_output()
Writes manager identity and shared release metadata to STDOUT.

Variable Documentation

◆ __manifest_manager_build_commit

__manifest_manager_build_commit

Source commit identifier injected into generated manager artifacts.

Bash variable: read-write string

◆ __manifest_manager_build_date

__manifest_manager_build_date

Source revision date injected into generated manager artifacts.

Bash variable: read-write string

◆ __manifest_manager_version

__manifest_manager_version

Shared bashdeps project version reported by the manager executable.

Bash variable: read-write string