main.rs is the entry point for the weaveback-tangle binary. It parses
command-line arguments with clap, builds a
`Clip`, reads the input files, writes all @file chunks to
disk via `SafeFileWriter`, and merges the run’s database
into the path given by --db (default weaveback.db).
See weaveback_tangle.adoc for the module map and architecture.adoc for the pipeline overview.
Arguments
| Flag | Default | Description |
|---|---|---|
|
|
Base directory for generated output files. |
|
|
Chunk open delimiter. |
|
|
Chunk close delimiter. |
|
|
Marker that closes a chunk definition. |
|
|
Comma-separated comment prefixes. |
|
— |
Formatter to run on files with a given extension. |
|
off |
Allow |
|
off |
Treat undefined chunk references as fatal errors (default: expand to nothing). |
|
off |
Print output paths without writing anything. |
|
|
Path to the persistent source-map database. |
|
— |
Named chunks to extract to stdout (or |
|
stdout |
Destination for |
|
— |
Input literate source files ( |
// <[@file weaveback-tangle/src/main.rs]>=
use ;
use Parser;
use HashMap;
use File;
use ;
use PathBuf;
Tests
Integration tests for the weaveback-tangle CLI binary. They use
assert_cmd to invoke the built binary as a subprocess and exercise the
full argument-parsing / chunk-extraction contract:
-
test_no_arguments_fails— no args → non-zero exit with "required" -
test_basic_chunk_extraction—@filechunk written togen/directory -
test_extract_specific_chunk_to_stdout—--chunksprints named chunk -
test_extract_chunk_to_file—--chunks --outputwrites chunk to file
// <[@file weaveback-tangle/tests/main_tests.rs]>=
use *;
use *;
use fs;
use Write;
use Command;
use tempdir;
// @@