gemtext2md_cli (gemtext2md v0.1.3)

View Source

The command line front end of gemtext2md, and the entry point of the gemtext2md escript.

gemtext2md [FILE | -]

With no argument, or with -, it reads standard input; with one argument it reads that file. Markdown goes to standard output. On failure it prints gemtext2md: MESSAGE to standard error and exits with status 1.

Input is read in chunks and passed to the streaming API of gemtext2md, as raw bytes, so that invalid UTF-8 is reported rather than silently re-encoded.

Summary

Functions

The escript entry point: runs on the command line arguments and halts with the exit status of run/2.

Run on a list of arguments (see the module description), writing the Markdown to Out.

Functions

main(Args)

-spec main([string()]) -> no_return().

The escript entry point: runs on the command line arguments and halts with the exit status of run/2.

run(Args, Out)

-spec run(Args, Out) -> non_neg_integer() when Args :: [string()], Out :: io:device().

Run on a list of arguments (see the module description), writing the Markdown to Out.

Returns the exit status, 0 or 1, instead of halting, so that it can be used from other code.