clix
Single-header file CLI libraries for C
Loading...
Searching...
No Matches
args.h: Callback Phases

Overview

Callback execution policies.

Lifecycle
Execution proceeds through parse, validate, and action stages. Internal schema checks happen inside library logic. Project-specific checks belong in your callbacks.

Callback Phases

enum  arg_callback_phase { ARG_CALLBACK_ALWAYS , ARG_CALLBACK_IF_SET , ARG_CALLBACK_IF_UNSET }
 Execution policy for argument::validate_phase and argument::action_phase. More...

Parser Generation

#define ARG_INVALID(msg)
 Creates a failing arg_callback value.
#define ARG_VALID()
 Creates a successful arg_callback value.

Data Structures

struct  arg_callback
 Result object returned by parser/validator callbacks. More...

Macro Definition Documentation

◆ ARG_INVALID

#define ARG_INVALID ( msg)

Creates a failing arg_callback value.

Parameters
msgDiagnostic message to show the user, e.g. "Must be a positive integer".

Enumeration Type Documentation

◆ arg_callback_phase

Execution policy for argument::validate_phase and argument::action_phase.

Enumerator
ARG_CALLBACK_ALWAYS 

Run regardless of user input state.

ARG_CALLBACK_IF_SET 

Run only when the argument was provided.

ARG_CALLBACK_IF_UNSET 

Run only when the argument was not provided.