Skip to content

Commit

Permalink
ADD default to parseopt
Browse files Browse the repository at this point in the history
  • Loading branch information
ZepHakase22 committed Apr 27, 2020
1 parent 1a06783 commit 0e27143
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 20 deletions.
3 changes: 3 additions & 0 deletions sbin/raspcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

scp $1 [email protected]:$2
70 changes: 59 additions & 11 deletions source/.vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@
"version": "2.0.0",
"tasks": [
{
"label": "make",
"label": "All",
"type": "shell",
"command": "make -j 8",
"command": "make",
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
]
},
{
"label": "clean",
Expand All @@ -24,17 +20,69 @@
]
},
{
"label": "rebuild",
"label": "release",
"type": "shell",
"command": "make release",
"problemMatcher": [
"$gcc"
]
},
{
"label": "debug",
"type": "shell",
"command": "make debug",
"problemMatcher": [
"$gcc"
]
},
{
"label": "static",
"type": "shell",
"command": "make static",
"problemMatcher": [
"$gcc"
]
},
{
"label": "static debug",
"type": "shell",
"command": "make staticdebug",
"problemMatcher": [
"$gcc"
]
},
{
"label": "dll",
"type": "shell",
"command": "make rebuild",
"command": "make dll",
"problemMatcher": [
"$gcc"
]
},
{
"label": "udp",
"label": "dll debug",
"type": "shell",
"command": "make dlldebug",
"problemMatcher": [
"$gcc"
]
},
{
"label": "footboard2PC debug",
"type": "shell",
"command": "make linux.d",
"problemMatcher": [
"$gcc"
],
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "udp debug",
"type": "shell",
"command": "make udp",
"command": "make udp.d",
"problemMatcher": [
"$gcc"
]
Expand Down
2 changes: 1 addition & 1 deletion source/Log.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ enum typelog {

struct structlog {
bool headers = false;
typelog level = INFO;
typelog level = WARN;
};

extern structlog LOGCFG;
Expand Down
2 changes: 1 addition & 1 deletion source/lastVersion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
raspbiandlld
linuxd
10 changes: 5 additions & 5 deletions source/parseopt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,20 @@ try
("h,help", "This help print message")
("l,list", "List the exsisting devices")
("m,usethread", "If present, use threads (default false) ")
("c,capacity", "In multithread mode is the queue capacity", cxxopts::value<ulong>());
("c,capacity", "If usethread is the queue capacity (default 2000)", cxxopts::value<ulong>());

options.add_options("DEVICE")
("s,serialnumber", "The device serial number", cxxopts::value<std::string>())
("d,description" , "The device description", cxxopts::value<std::string>())
("f,FIFO-buffer","Number of bytes read from device",cxxopts::value<ulong>());
("f,FIFO-buffer","Number of bytes read from device (default 4096)",cxxopts::value<ulong>());

options.add_options("WI-FI")
("u,UDP-buffer","Set the transmission buffer size",cxxopts::value<ulong>())
("p,port", "The number of the socket port to communicate",cxxopts::value<uint>());
("u,UDP-buffer","Set the transmission buffer size (default 4096)",cxxopts::value<ulong>())
("p,port", "Socket port to communicate (default 80)",cxxopts::value<uint>());

options.add_options("POSITIONAL")
("ip-address","The Server Ip Address",cxxopts::value<std::string>())
("level-log", "Required level log",cxxopts::value<std::string>());
("level-log", "Required level log (default WARN)",cxxopts::value<std::string>());

options.parse_positional({"ip-address","level-log","positional"});

Expand Down
4 changes: 2 additions & 2 deletions source/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ typedef struct _parser {
isSerialNumber=true;
isMultiThread=false;
port=80;
udp_buffer=2048;
fifo_buffer=2048;
udp_buffer=4096;
fifo_buffer=4096;
queue_capacity=2000;
}
bool isListing;
Expand Down

0 comments on commit 0e27143

Please sign in to comment.