ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
mdl_cli_usage.c File Reference

Stable command-line help rendering for mdl. More...

#include "mdl_cli.h"
#include "mdl_cli_internal.h"
#include "ra8_attributes.h"
Include dependency graph for mdl_cli_usage.c:

Go to the source code of this file.

Functions

static ra8_err_t internal_cli_usage_discovery (ra8_io_stream_t *diagnostic, const char *a0)
 Write series, discovery, and library help sections.
static ra8_err_t internal_cli_usage_actions (ra8_io_stream_t *diagnostic, const char *a0)
 Write verify, init, pack, artifact, and direct-page help sections.
static ra8_err_t internal_cli_usage_network_options (ra8_io_stream_t *diagnostic)
 Write the identity, politeness, and network CLI options.
ra8_err_t mdl_cli_usage (ra8_io_stream_t *diagnostic, const char *a0)
 Write the complete usage block to an injected byte stream.

Detailed Description

Stable command-line help rendering for mdl.

Owns only process-edge usage text so the parser translation unit stays below the repository size cap without sharing parser state.

Definition in file mdl_cli_usage.c.

Function Documentation

◆ internal_cli_usage_actions()

ra8_err_t internal_cli_usage_actions ( ra8_io_stream_t * diagnostic,
const char * a0 )
static

Write verify, init, pack, artifact, and direct-page help sections.

Parameters
[in,out]diagnosticBound destination for the usage text.
[in]a0NUL-terminated program name displayed in examples.
Returns
Canonical stream status.
Return values
k_ra8_okEvery section was accepted completely.
otherThe stream rejected one fragment.
Precondition
diagnostic and a0 are non-NULL.
a0 is NUL-terminated.
Postcondition
Success describes every non-discovery primary mode exactly once.
Failure stops at the first rejected fragment.
Note
Thread-safe across distinct streams.
Since
0.1.0

Writes fixed help fragments in order through the injected stream. The first sink error stops later output and is returned unchanged.

Definition at line 81 of file mdl_cli_usage.c.

References priv_mdl_cli_put_parts(), and RA8_INTERNAL.

Referenced by mdl_cli_usage().

◆ internal_cli_usage_discovery()

ra8_err_t internal_cli_usage_discovery ( ra8_io_stream_t * diagnostic,
const char * a0 )
static

Write series, discovery, and library help sections.

Parameters
[in,out]diagnosticBound destination for the usage text.
[in]a0NUL-terminated program name displayed in usage examples.
Returns
Canonical stream status.
Return values
k_ra8_okThe section was accepted completely.
otherThe stream rejected one fragment.
Precondition
diagnostic and a0 are non-NULL and a0 is NUL-terminated.
Postcondition
Success describes series, search, browse, and library modes.
Failure stops at the first rejected fragment.
Note
Thread-safe across distinct streams.
Since
0.1.0

Writes fixed help fragments in order through the injected stream. The first sink error stops later output and is returned unchanged.

Precondition
Every required pointer is non-null and remains valid for the call.

Definition at line 30 of file mdl_cli_usage.c.

References priv_mdl_cli_put_parts(), and RA8_INTERNAL.

Referenced by mdl_cli_usage().

◆ internal_cli_usage_network_options()

ra8_err_t internal_cli_usage_network_options ( ra8_io_stream_t * diagnostic)
static

Write the identity, politeness, and network CLI options.

Parameters
[in,out]diagnosticBound destination for the usage text.
Returns
Canonical stream status.
Return values
k_ra8_okThe complete section was accepted.
otherThe stream rejected the section.
Precondition
diagnostic is non-NULL and bound.
Invocation is serialized with other writers to the same stream.
Postcondition
Every supported network-policy option is described exactly once.
No parser state or caller-owned storage is modified.
Note
Synchronous process-edge output; no ownership is transferred.
Since
0.1.0

Writes fixed help fragments in order through the injected stream. The first sink error stops later output and is returned unchanged.

Definition at line 131 of file mdl_cli_usage.c.

References RA8_INTERNAL, and ra8_io_stream_puts().

Referenced by mdl_cli_usage().

◆ mdl_cli_usage()

ra8_err_t mdl_cli_usage ( ra8_io_stream_t * diagnostic,
const char * a0 )
nodiscard

Write the complete usage block to an injected byte stream.

Parameters
[in,out]diagnosticBound stream receiving the help text.
[in]a0argv[0], the program name shown in the usage lines.
Returns
Canonical stream status.
Return values
k_ra8_okThe complete usage block was accepted.
k_ra8_err_null_ptrA required pointer was null.
otherThe injected stream rejected a write.
Precondition
diagnostic is bound and exclusively owned for the call.
a0 is a NUL-terminated string.
Postcondition
Success writes the exact complete usage block.
Failure stops at the first rejected stream operation.
Note
Thread-safe across distinct streams.
Since
0.1.0

Definition at line 153 of file mdl_cli_usage.c.

References internal_cli_usage_actions(), internal_cli_usage_discovery(), internal_cli_usage_network_options(), k_ra8_err_null_ptr, k_ra8_ok, and priv_mdl_cli_put_parts().

Referenced by main().