README

bobzhang/html_parser/cli does not have a README file

#
CliReadPlan

pub(all) enum CliReadPlan {
CliImmediate(CliResult)
CliReadPath(String)
} derive(Eq,
Debug
)

Describes how the CLI should obtain input after argument parsing.

CliImmediate means parsing already produced a complete result, such as help, version output, or an argument error. CliReadPath asks the caller to read the given path, where "-" conventionally means standard input.

#
CliResult

pub(all) struct CliResult {
exit_code : Int
stdout : String
stderr : String
file_output_path : String?
file_output_content : String?
} derive(Eq,
Debug
)

Result produced by the embeddable CLI runner.

stdout and stderr contain terminal output. When file_output_path is present, file_output_content contains the bytes that a shell wrapper should write to that path instead of printing to standard output.

#
cli_help

fn cli_help() -> String

Return the CLI usage text.

#
cli_read_plan

fn cli_read_plan(args : ArrayView[String]) -> CliReadPlan

Parse CLI arguments and report whether the caller must read an input path.

Use this when integrating with an environment that performs its own file or standard-input IO. For direct byte input, use run_cli_bytes.

#
run_cli_bytes

fn run_cli_bytes(args : ArrayView[String], input : BytesView) -> CliResult

Run the JustHTML-compatible CLI over already-read input bytes.

args should contain only command-line arguments after the executable name. The returned CliResult captures exit status, terminal output, and optional output-file content for the caller to write.

#
run_cli_with_reader

fn run_cli_with_reader(args : ArrayView[String], read_input : (String) -> Bytes) -> CliResult

Run the CLI with caller-provided path reading.

The callback receives the input path selected by argument parsing. This is useful for native or embedded hosts that want the library to handle CLI options while the host owns filesystem or standard-input IO.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io