7{
9
10 {
13 info.
param =
"--version";
15 info.
help =
"Version information for ArgParser-C";
16
18 }
19
20 {
23 info.
param =
"--help";
25 info.
help =
"Show this help";
26
27 cvec_push(&info.
aliases,
const char *,
"-?");
28
30 }
31
32 if (
apc_get(&parser,
"version"))
33 {
34 printf("== VERSION INFO\n");
35 printf("- VERSION: %i.%i.%i\n",
41 }
42
43 else if (
apc_get(&parser,
"help"))
44 {
45 const char *licenseMessage =
46 "\nArgPar-C Copyright (C) 2026 pcannon09\n"
47 "This program comes with ABSOLUTELY NO WARRANTY; for details type `./run.sh --help'.\n"
48 "This is free software, and you are welcome to redistribute it\n"
49 "under certain conditions; type `./run.sh --help' for details.";
50
52 &parser,
53 "APC Help",
54 "ArgParser-C help information and demo\nCheck the code for more information\n",
55 licenseMessage);
56
57 printf("%s\n", helpMsg);
58
60 }
61
63
64 return 0;
65}
bool apc_get(APC_ArgParser *argpar, const char *id)
Get if there is an argument present.
char * apc_generateHelp(APC_ArgParser *argpar, const char *title, const char *topInfo, const char *lowerInfo)
Automatically generate help and pass it to the string to return.
bool apc_add(APC_ArgParser *argpar, APC_ArgInfo info)
Setup Arg Information to the argpar.
APC_ArgParser apc_init(int argc, char *argv[])
Initialize parser with argc and argv from the main() function.
APC_ArgInfo apc_initInfo(void)
Initialize information for params.
void apc_destroy(APC_ArgParser *argpar)
Free all allocated data for argument parser.
#define APC_VERSION_MINOR
#define APC_VERSION_MAJOR
#define APC_VERSION_PATCH
#define APC_VERSION_STATE