CBuild
C++ build system with scripts written in c++
Loading...
Searching...
No Matches
cli_parse_handler.hpp
Go to the documentation of this file.
1
22#ifndef __CBUILD_CLI_PARSE_HANDLER_HPP__
23#define __CBUILD_CLI_PARSE_HANDLER_HPP__
24// C++ libraries
25#include "string"
26// Project headers
27#include "CBuild.hpp"
28#include "map.hpp"
29// Code
30namespace CBuild {
31void exit(int code);
134bool register_parse_handler(std::string cmd, CBuild::handler parser);
135} // namespace CBuild
136#endif // __CBUILD_CLI_PARSE_HANDLER_HPP__
Main headers of CBuild core.
Simple map implementation with some stack operation added.
Definition map.hpp:79
Custom implementation of map datatype.
Filebuffer for CBuild ecosystem.
Definition Build.hpp:34
ARG_TYPE(*)(lib::map< std::string, std::string > *, char **, int, int, CBuild::RType *) handler
Handler for specific argument.
void exit(int code)
RType
Run mode.
Definition CBuild.hpp:34
ARG_TYPE
Type of argument, indicate how many tokens this argument consumes, including self.
@ SIMPLE_ARG
Only argument and no subarguments (like -f, -v)
@ BLANK_ARG
No argument.
@ GENERATOR_ARG
Generator arg (-g <generator_id>)
@ INC_THREE
Increment by two, consumes self and 2 subarg.
@ TASK_ARG
Task argument (-t <task_id>)
@ INC_TWO
Increment by two, consumes self and 1 subarg.
@ INC_ONE
Increment by one, consumes only self.
@ INC_FIVE
Increment by two, consumes self and 4 subarg.
@ INC_EIGHT
Increment by two, consumes self and 7 subarg.
@ INC_FOUR
Increment by two, consumes self and 3 subarg.
@ GENERICK_ARG
Generick argument with subargument (-<arg> <subarg>
@ INC_NINE
Increment by two, consumes self and 8 subarg.
@ INC_SEVEN
Increment by two, consumes self and 6 subarg.
@ TOOLCHAIN_ARG
Toolchain argument (-b/-r/-br/-c/-d <toolchain_id>)
@ INC_TEN
Increment by two, consumes self and 9 subarg.
@ INC_SIX
Increment by two, consumes self and 5 subarg.
bool register_parse_handler(std::string cmd, CBuild::handler parser)
Register new handler for parsing cli args, see handler typedef comment to guide how to write handlers...
Command for compile_commands.json.