Skip to content

ArgRole

Description

What kind of slot this is (value option, flag, count, positional). Registration verbs map 1:1 to this enum.

Usage example (Cross-references)

Usage examples (Cross-references)
    void arg_register(
        ArgParse   *self,
        ArgRole     role,
        const char *short_name,
        const char *long_name,
            ARG_ROLE_COUNT,      // no value, increments per occurrence (integer target)
            ARG_ROLE_POSITIONAL, // value, positional slot (always required)
        } ArgRole;
    
        ///
            const char *long_name;  // "--listen" for options; metavar (e.g. "hostname") for positionals
            const char *help;       // one-line description for `--help`
            ArgRole     role;
            ArgKind     kind;
            void       *target;
        void arg_register(
            ArgParse   *self,
            ArgRole     role,
            const char *short_name,
            const char *long_name,
Last updated on