mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-02-18 15:28:41 +01:00
New command line app and removing slsDetectorCommand (#69)
* WIP * WIP * WIP * WIP * config2 working * removed slsDetectorCommand * WIP * added test file * more tests
This commit is contained in:
committed by
Dhanya Thattil
parent
6a27207875
commit
fa2c842745
@@ -24,6 +24,7 @@ void CmdLineParser::Print() {
|
||||
};
|
||||
|
||||
void CmdLineParser::Parse(int argc, const char *const argv[]) {
|
||||
Reset();
|
||||
executable_ = argv[0]; // first arg is calling binary
|
||||
if (argc > 1) {
|
||||
std::string s = argv[1];
|
||||
@@ -36,6 +37,7 @@ void CmdLineParser::Parse(int argc, const char *const argv[]) {
|
||||
}
|
||||
|
||||
void CmdLineParser::Parse(const std::string &s) {
|
||||
Reset();
|
||||
std::istringstream iss(s);
|
||||
auto it = std::istream_iterator<std::string>(iss);
|
||||
arguments_ =
|
||||
@@ -109,4 +111,13 @@ std::string CmdLineParser::cli_line() const{
|
||||
return os.str();
|
||||
}
|
||||
|
||||
void CmdLineParser::Reset(){
|
||||
multi_id_ = 0;
|
||||
detector_id_ = -1;
|
||||
help_ = false;
|
||||
command_.clear();
|
||||
executable_.clear();
|
||||
arguments_.clear();
|
||||
}
|
||||
|
||||
} // namespace sls
|
||||
Reference in New Issue
Block a user