Skip to content

Commit 2ffb846

Browse files
committed
Updated README.md
1 parent 95407d0 commit 2ffb846

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

CMakeLists.txt

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ project(wsjcpp-arguments)
55
include(${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

1210
set(CMAKE_CXX_STANDARD 11)
@@ -16,9 +14,12 @@ set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-arguments_SOURCE_DIR})
1614

1715
# include header dirs
1816
list (APPEND WSJCPP_INCLUDE_DIRS "src")
17+
list (APPEND WSJCPP_INCLUDE_DIRS "src/ArgumentProcessors")
1918

2019
list (APPEND WSJCPP_SOURCES "src/wsjcpp_arguments.h")
2120
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")
2223
list (APPEND WSJCPP_SOURCES "src/main.cpp")
2324

2425
include_directories(${WSJCPP_INCLUDE_DIRS})

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,20 @@
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
```
1010
wsjcpp 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

@@ -86,7 +88,7 @@ usage:
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

src/argument_processor_main.cpp renamed to src/ArgumentProcessors/argument_processor_main.cpp

+7-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66
// ArgumentProcessorMain
77

88
ArgumentProcessorMain::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

3739
int 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

0 commit comments

Comments
 (0)