You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -60,6 +63,53 @@ int main(int argc, char* argv[]) {
60
63
}
61
64
```
62
65
66
+
## Help Command
67
+
To display help information, use the following commands:
68
+
69
+
```cmd
70
+
./<exe-name>.exe -h
71
+
```
72
+
or
73
+
```cmd
74
+
./<exe-name>.exe --help
75
+
```
76
+
77
+
Upon execution, it will output:
78
+
```
79
+
Argument Parser v1.1
80
+
81
+
DESCRIPTION:
82
+
This project can be used to parse command line arguments
83
+
USAGE:
84
+
-b, --bool : This is a flag argument
85
+
-d, --double : This is a double argument
86
+
-i, --int : This is a int argument
87
+
-s, --string : This is a string argument
88
+
```
89
+
Replace `<exe-name>` with the actual name of your executable. This section provides a quick guide on how users can access `help` information along with an example output showcasing the available command-line arguments.
90
+
91
+
Otherthan that user can add own help command with built-in help command, then the user specified function will execute before `help` command.
92
+
93
+
```cpp
94
+
// Example user-specified callback
95
+
void userSpecifiedCallback() {
96
+
printf("Executing user-specified callback before the built-in help command.");
97
+
}
98
+
99
+
int main(int argc, char* argv[]) {
100
+
ArgParser parser;
101
+
102
+
// Set user-specified callback for help
103
+
parser.setHelpCallback(userSpecifiedCallback);
104
+
105
+
// Parse command-line arguments
106
+
parser.parse(argc, argv);
107
+
108
+
// ... rest of the program
109
+
return 0;
110
+
}
111
+
```
112
+
63
113
## Examples
64
114
65
115
Here are some examples demonstrating the usage of ArgParser:
0 commit comments