76 void parser(
const std::string &option);
106 bool find_args(
const std::string &arg)
const;
121 void ShowCmds(FILE * file=stdout)
const;
BuiltInScriptMap g_BuildScripts(g_builtin_cmd)
A map of the built-in scripts' names to their BuiltInScript representations.
const char * g_vt_kcyn
Definition uuu.cpp:56
const char * g_vt_boldwhite
Definition uuu.cpp:57
const char * g_vt_default
Definition uuu.cpp:53
const char * g_vt_green
Definition uuu.cpp:54
const char * g_vt_yellow
Definition uuu.cpp:52
const char * g_vt_red
Definition uuu.cpp:55
A map of all built-in scripts indexed by their names.
Definition buildincmd.h:115
BuiltInScriptMap(const BuiltInScriptRawData *p)
Create a new map by parsing an array of BuiltInScriptRawData instances.
Definition buildincmd.cpp:185
void ShowCmds(FILE *file=stdout) const
Print the names of all contained scripts to the given stream.
Definition buildincmd.cpp:226
void PrintAutoComplete(const std::string &match, const char *space=" ") const
Auto-complete names of built-in scripts if they match match
Definition buildincmd.cpp:200
void ShowAll() const
Print information about all contained scripts to stdout.
Definition buildincmd.cpp:214
A class for representing arguments of built-in scripts represented by BuiltInScript.
Definition buildincmd.h:67
void parser(const std::string &option)
Parse characters between argument name and its description and check if its an optional one.
Definition buildincmd.cpp:48
std::string m_name
The name of the argument.
Definition buildincmd.h:79
uint32_t m_flags
Flags of the argument (basically if it's optional or not)
Definition buildincmd.h:83
std::string m_desc
A description of the argument.
Definition buildincmd.h:81
std::string m_fallback_option
Definition buildincmd.h:86
@ ARG_OPTION
Definition buildincmd.h:72
@ ARG_OPTION_KEY
Definition buildincmd.h:73
@ ARG_MUST
Definition buildincmd.h:71
const std::string m_text
The actual script which is being represented.
Definition buildincmd.h:97
std::vector< Arg > m_args
The arguments of the built-in script.
Definition buildincmd.h:103
bool find_args(const std::string &arg) const
Check if the BuiltInScript instance has an argument called arg
Definition buildincmd.cpp:113
const std::string m_name
A short name of the built-in script.
Definition buildincmd.h:101
const std::string m_desc
A description of the script's purpose.
Definition buildincmd.h:99
void show_cmd() const
Print the script's name, its description and its arguments to stdout.
Definition buildincmd.cpp:163
std::string replace_script_args(const std::vector< std::string > &args) const
Replace built-in script's arguments by actual values given in args
Definition buildincmd.cpp:126
BuiltInScript()
Definition buildincmd.h:89
void show() const
Print the built-in script to stdout followed by a newline.
Definition buildincmd.cpp:155
Structure to hold the raw data of a built-in script.
Definition buildincmd.h:50
const char *const m_name
The name of the built-in script.
Definition buildincmd.h:52
const char *const m_text
The actual built-in script itself.
Definition buildincmd.h:54
const char *const m_desc
A description of the built-in script's purpose.
Definition buildincmd.h:56