Skip to main content

Module cli

Module cli 

Source
Expand description

CLI module for the slab file maintenance tool.

This module implements the slab binary, a command-line interface for creating, inspecting, and transforming slabtastic files. Each subcommand lives in its own child module and is dispatched by run.

§Subcommands

CommandDescription
analyzeDisplay file structure and statistics
checkValidate a slab file for structural errors
getRetrieve records by ordinal (hex, base64, or raw output)
importImport records from external formats (CSV, JSON, etc.)
exportExport records to external formats or another slab file
appendAppend records from stdin or a source file
rewriteRepack a slab file with new page settings
explainDisplay block diagrams of page layouts
namespacesList all namespaces in a slab file
completionsGenerate shell completions (bash, zsh, fish, etc.)

§Helpers

Modules§

analyze
slab analyze subcommand — display file structure and statistics.
append
slab append subcommand — append data to an existing slabtastic file.
check
slab check subcommand — validate slabtastic file structure.
explain
slab explain subcommand — render page layouts as block diagrams.
export
slab export subcommand — export content from a slab file.
get
slab get subcommand — retrieve records by ordinal.
import
slab import subcommand — import data from external file formats into a slab file.
namespaces
slab namespaces subcommand — list all namespaces in a slab file.
ordinal_range
Ordinal range parser for CLI commands.
rewrite
slab rewrite subcommand — rewrite a slabtastic file, reordering by ordinal and repacking to new page settings in a single pass.

Structs§

Cli
slab — slabtastic file maintenance tool
ProgressReporter
Optional progress reporter that prints record counts to stderr.

Enums§

Command
Available subcommands.

Functions§

is_new_file
Return true when the target path does not yet exist, meaning the operation will create a new file (as opposed to appending).
make_writer_config
Build a WriterConfig from optional CLI flags, falling back to defaults.
run
Dispatch to the appropriate subcommand.
write_with_buffer_rename
Write to a .buffer suffixed temporary file, then rename to the target path on success.