31typedef enum : uint8_t {
The downloader's portable application layer: one run mode, one call.
const char * mdl_cli_mode_name(mdl_cli_mode_t mode)
Stable human-readable command mode name.
ra8_err_t mdl_cli_validate(const mdl_args_t *a, ra8_io_stream_t *diagnostic, mdl_cli_mode_t *mode)
Validate mode selection, required arguments, and per-mode options.
ra8_err_t mdl_cli_parse_nums(const mdl_args_t *a, ra8_io_stream_t *diagnostic, mdl_nums_t *n)
Strictly parse and validate every numeric CLI field.
mdl_cli_mode_t
Exactly one command mode selected by a valid invocation.
@ k_mdl_cli_mode_verify
Verify tracked state/pages/containers.
@ k_mdl_cli_mode_series
Download or update one configured series.
@ k_mdl_cli_mode_artifact
Download one verified HTTPS artifact.
@ k_mdl_cli_mode_page
Debug-download images from one page URL.
@ k_mdl_cli_mode_invalid
No valid primary mode.
@ k_mdl_cli_mode_search
Search a descriptor and optionally pick.
@ k_mdl_cli_mode_pack
Package a local page-image directory.
@ k_mdl_cli_mode_update_all
Update every tracked local series.
@ k_mdl_cli_mode_help
Print command help without running a mode.
@ k_mdl_cli_mode_list
List tracked local series.
@ k_mdl_cli_mode_remove
Remove one tracked local series.
@ k_mdl_cli_mode_browse
Browse a descriptor and optionally pick.
@ k_mdl_cli_mode_version
Print the program version and exit.
@ k_mdl_cli_mode_init_site
Generate a starter descriptor template.
mdl_run_opts_t mdl_cli_run_opts(const mdl_args_t *a)
Fold parsed args into the cross-cutting run options.
void mdl_cli_parse(int argc, char **argv, mdl_args_t *a)
Parse argv into a; numeric fields stay as strings for main.
ra8_err_t mdl_cli_usage(ra8_io_stream_t *diagnostic, const char *a0)
Write the complete usage block to an injected byte stream.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
ra8_io targetable byte-stream facade – one writer, many destinations.
Parsed command-line options in string form (converted by main).
const char * proxy
–proxy URL: HTTP/HTTPS proxy URL.
const char * verify_dir
–verify [DIR]: directory to verify.
bool update
–update: fetch only chapters not already complete.
const char * pack
–pack DIR: package an existing folder, no network.
const char * chapters
–chapters.
const char * cfg
–config path.
const char * timeout
–timeout.
const char * page_url
positional page URL (page mode).
bool allow_incomplete
–allow-incomplete: package a run with failed pages.
bool allow_private
–allow-private: permit loopback/private/link-local peers.
const char * remove_series
–remove: series URL/slug to drop from the library.
const char * socks5
–socks5 URL: SOCKS5 proxy URL.
bool verify
–verify: verify existing downloaded archives/files.
const char * contact
–contact: operator identity for the User-Agent.
bool polite
–polite: raise per-host delays.
const char * ca_file
–ca-file FILE: host composition CA input path.
bool progress
–progress: terminal progress bar during downloads.
bool bad
An unrecognised argument was seen.
bool ignore_robots
–ignore-robots: escape hatch (off by default).
const char * out
–out dir.
const char * init_site_url
–init-site URL: generate site descriptor template.
bool update_all
–update-all: incremental update of every tracked series.
bool help
–help/-h: print usage and exit successfully.
bool list
–list: list tracked series with coverage, then exit.
const char * cookie_file
–cookie-file FILE: host composition input path.
bool version
–version: print version and exit successfully.
bool browse
–browse: list a site's latest-updates page.
const char * max_bytes
–max-bytes: per-response size cap.
const char * cache_dir
–cache-dir: persistent per-host cache root.
bool cross_host
–cross-host: permit cross-host redirects.
bool refetch
–refetch: bypass verified local page reuse.
const char * pick
–pick N: download the Nth discovery hit (1-based).
const char * series
–series URL.
bool separate
–separate: one archive per chapter (default: combine).
const char * from
–from: first chapter NUMBER to fetch (not an index).
const char * format
–format (cbz/cbt/cbt.gz/epub/jof/rabook).
The validated numeric CLI scalars, parsed once before any run mode.
size_t pick
–pick discovery hit (1-based; 0 = list).
bool from_present
Whether –from was supplied.
uint32_t timeout
–timeout ms (default k_req_timeout_def).
size_t chapters
–chapters window (clamped to >= 1).
uint32_t max_imgs
–max page images (0 = all).
uint64_t seed
–seed (default 1).
double from_num
–from chapter number, including decimals.
Cross-cutting policy and injected transport threaded into every mode.
Caller-allocated byte-stream handle binding a sink to its context.