BFC-Compiler
A C23 Brainfuck compiler
Loading...
Searching...
No Matches
bfc_cli.h File Reference

Command-line parsing interface. More...

#include <stdbool.h>
#include "bfc_error.h"

Go to the source code of this file.

Data Structures

struct  bfc_args_t
 Parsed command-line state. More...

Functions

void bfc_cmd_help (void)
 Prints command-line usage and option descriptions.
bfc_error_t bfc_process_args (bfc_args_t *cmd_args, int argc, char *const argv[])
 Parses compiler command-line arguments.

Detailed Description

Command-line parsing interface.

Defines parsed compiler options and the command-line processor.

Function Documentation

◆ bfc_cmd_help()

void bfc_cmd_help ( void )

Prints command-line usage and option descriptions.

Renders usage text from the same option table used for parsing.

Prints command-line usage and option descriptions.

◆ bfc_process_args()

bfc_error_t bfc_process_args ( bfc_args_t * cmd_args,
int argc,
char *const argv[] )

Parses compiler command-line arguments.

Parses options, option values, the end-of-options marker, and one input path.

Parameters
[out]cmd_argsReceives zero-initialized parsed arguments.
[in]argcArgument count.
[in]argvArgument vector.
Returns
BFC_ERR_OK on success; otherwise an argument error.

Parses compiler command-line arguments.