Skip to main content

Crate aube

Crate aube 

Source
Expand description

aube’s command layer as a library.

The aube / aubr / aubx binaries are thin wrappers over cli_main; everything else lives here so the command layer can be embedded by other tools — e.g. constructing commands::install::InstallOptions and calling commands::install::run in-process instead of shelling out to the CLI. The public surface is deliberately small: commands (command implementations and their args/options structs), cli_args (the shared clap argument groups flattened into command args), and cli_main. Everything else is crate-private plumbing shared by the commands.

The library makes no global-allocator choice — the mimalloc opt-in lives in src/main.rs so embedders keep control of their own allocator.

Modules§

cli_args
Shared clap::Args groups flattened into per-command argument structs.
commands

Functions§

cli_main
Library entry point. An embedder calls this with its own &'static Embedder (and optional setting defaults); the aube binary passes &aube_util::AUBE and no defaults, reproducing standalone behavior. This is the whole embedding API: register-then-run in one call, so a host never has to separately wire identity and defaults.
cli_main_with_defaults
cli_main plus embedder-supplied setting defaults. The defaults are (canonical_setting_name, raw_value) pairs registered at the lowest precedence tier — below every user- and project-level source — for the genuinely user-overridable knobs an embedder wants to re-default. (Embedder-fixed behavior lives on aube_util::Embedder itself, not here.) Standalone aube passes an empty vec, so per-setting built-in defaults apply unchanged.
command
The clap Command for the CLI, with its version reset to the plain package version (stripping the -DEBUG runtime suffix) so any derived artifact stays byte-stable across profiles. This exposes the command surface itself — not aube’s own usage KDL subcommand, which is aube-specific tooling that lives in the binary (src/main.rs), not in the embeddable command layer. A downstream embedder builds its own top-level usage/completions from this.