File tree Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Expand file tree Collapse file tree 4 files changed +19
-14
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,6 @@ project(wsjcpp-arguments)
55include (${CMAKE_CURRENT_SOURCE_DIR} /src.wsjcpp/CMakeLists.txt)
66
77#### BEGIN_WSJCPP_APPEND
8- list (APPEND WSJCPP_SOURCES "./src/argument_processor_main.h" )
9- list (APPEND WSJCPP_SOURCES "./src/argument_processor_main.cpp" )
108#### END_WSJCPP_APPEND
119
1210set (CMAKE_CXX_STANDARD 11)
@@ -16,9 +14,12 @@ set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-arguments_SOURCE_DIR})
1614
1715# include header dirs
1816list (APPEND WSJCPP_INCLUDE_DIRS "src" )
17+ list (APPEND WSJCPP_INCLUDE_DIRS "src/ArgumentProcessors" )
1918
2019list (APPEND WSJCPP_SOURCES "src/wsjcpp_arguments.h" )
2120list (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" )
2223list (APPEND WSJCPP_SOURCES "src/main.cpp" )
2324
2425include_directories (${WSJCPP_INCLUDE_DIRS} )
Original file line number Diff line number Diff line change 22
33[ ![ 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 )
44
5- Helpful parser for parsing application arguments
5+ Parsing and handling for application arguments
66
7- ## Installing
7+ ## Intagrate to your project
88
99```
1010wsjcpp install "https://github.com/wsjcpp/wsjcpp-arguments:master"
1111```
1212
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
1719
1820## Example usage
1921
8688#include "argument_processor_main.h"
8789
8890
89- int main() {
91+ int main(int argc, const char* argv[] ) {
9092 ArgumentProcessorMain *pMain = new ArgumentProcessorMain();
9193 WSJCppArguments prog(argc, argv, pMain);
9294
Original file line number Diff line number Diff line change 66// ArgumentProcessorMain
77
88ArgumentProcessorMain::ArgumentProcessorMain ()
9- : WSJCppArgumentProcessor({" main" }, " TODO description " ) {
9+ : WSJCppArgumentProcessor({" main" }, " Examples " ) {
1010 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" );
1416 // registryProcessor(new ArgumentProcessorOtherProcessor());
1517}
1618
@@ -36,6 +38,6 @@ bool ArgumentProcessorMain::applyParameterArgument(
3638
3739int ArgumentProcessorMain::exec (const std::string &sProgramName , const std::vector<std::string> &vSubParams) {
3840 WSJCppLog::err (TAG, " Not implemented" );
39- return -1 ;
41+ return -1 ;
4042}
4143
File renamed without changes.
You can’t perform that action at this time.
0 commit comments