File tree 4 files changed +19
-14
lines changed
4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ project(wsjcpp-arguments)
5
5
include (${CMAKE_CURRENT_SOURCE_DIR} /src.wsjcpp/CMakeLists.txt)
6
6
7
7
#### BEGIN_WSJCPP_APPEND
8
- list (APPEND WSJCPP_SOURCES "./src/argument_processor_main.h" )
9
- list (APPEND WSJCPP_SOURCES "./src/argument_processor_main.cpp" )
10
8
#### END_WSJCPP_APPEND
11
9
12
10
set (CMAKE_CXX_STANDARD 11)
@@ -16,9 +14,12 @@ set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-arguments_SOURCE_DIR})
16
14
17
15
# include header dirs
18
16
list (APPEND WSJCPP_INCLUDE_DIRS "src" )
17
+ list (APPEND WSJCPP_INCLUDE_DIRS "src/ArgumentProcessors" )
19
18
20
19
list (APPEND WSJCPP_SOURCES "src/wsjcpp_arguments.h" )
21
20
list (APPEND WSJCPP_SOURCES "src/wsjcpp_arguments.cpp" )
21
+ list (APPEND WSJCPP_SOURCES "src/ArgumentProcessors/argument_processor_main.h" )
22
+ list (APPEND WSJCPP_SOURCES "src/ArgumentProcessors/argument_processor_main.cpp" )
22
23
list (APPEND WSJCPP_SOURCES "src/main.cpp" )
23
24
24
25
include_directories (${WSJCPP_INCLUDE_DIRS} )
Original file line number Diff line number Diff line change 2
2
3
3
[ ![ Build Status] ( https://api.travis-ci.org/wsjcpp/wsjcpp-arguments.svg?branch=master )] ( https://travis-ci.org/wsjcpp/wsjcpp-arguments ) [ ![ Github Stars] ( https://img.shields.io/github/stars/wsjcpp/wsjcpp-arguments.svg?label=github%20%E2%98%85 )] ( https://github.com/wsjcpp/wsjcpp-arguments/stargazers ) [ ![ Github Stars] ( https://img.shields.io/github/contributors/wsjcpp/wsjcpp-arguments.svg )] ( https://github.com/wsjcpp/wsjcpp-arguments/ ) [ ![ Github Forks] ( https://img.shields.io/github/forks/wsjcpp/wsjcpp-arguments.svg?label=github%20forks )] ( https://github.com/wsjcpp/wsjcpp-arguments/network/members )
4
4
5
- Helpful parser for parsing application arguments
5
+ Parsing and handling for application arguments
6
6
7
- ## Installing
7
+ ## Intagrate to your project
8
8
9
9
```
10
10
wsjcpp install "https://github.com/wsjcpp/wsjcpp-arguments:master"
11
11
```
12
12
13
- or specify version:
14
- ```
15
- wsjcpp install "https://github.com/wsjcpp/wsjcpp-arguments:v0.0.1"
16
- ```
13
+ or include this files:
14
+
15
+ * src.wsjcpp/wsjcpp_core/wsjcpp_core.h
16
+ * src.wsjcpp/wsjcpp_core/wsjcpp_core.cpp
17
+ * src/wsjcpp_arguments.cpp
18
+ * src/wsjcpp_arguments.h
17
19
18
20
## Example usage
19
21
86
88
#include "argument_processor_main.h"
87
89
88
90
89
- int main() {
91
+ int main(int argc, const char* argv[] ) {
90
92
ArgumentProcessorMain *pMain = new ArgumentProcessorMain();
91
93
WSJCppArguments prog(argc, argv, pMain);
92
94
Original file line number Diff line number Diff line change 6
6
// ArgumentProcessorMain
7
7
8
8
ArgumentProcessorMain::ArgumentProcessorMain ()
9
- : WSJCppArgumentProcessor({" main" }, " TODO description " ) {
9
+ : WSJCppArgumentProcessor({" main" }, " Examples " ) {
10
10
TAG = " ArgumentProcessorMain" ;
11
- // registrySingleArgument("--single", "What exactly do this single param?");
12
- // registryParameterArgument("-param", "What need this param?");
13
- // registryExample("here example of command");
11
+ registrySingleArgument (" --single1" , " Single 1" );
12
+ registrySingleArgument (" --single2" , " Single 2" );
13
+ registryParameterArgument (" -param1" , " Param 1" );
14
+ registryParameterArgument (" -param2" , " Param 2" );
15
+ registryExample (" wsjcpp --single1 -param1 1" );
14
16
// registryProcessor(new ArgumentProcessorOtherProcessor());
15
17
}
16
18
@@ -36,6 +38,6 @@ bool ArgumentProcessorMain::applyParameterArgument(
36
38
37
39
int ArgumentProcessorMain::exec (const std::string &sProgramName , const std::vector<std::string> &vSubParams) {
38
40
WSJCppLog::err (TAG, " Not implemented" );
39
- return -1 ;
41
+ return -1 ;
40
42
}
41
43
File renamed without changes.
You can’t perform that action at this time.
0 commit comments