Skip to content

Commit

Permalink
some patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Ackimixs committed Nov 4, 2023
1 parent 53b1ee2 commit 145d847
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions include/Args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ void checkArgs(std::map<std::string, std::vector<std::string>> args) {
}
}

void runGraph(std::map<std::string, std::vector<std::string>> args) {
void runGraphArgs(std::map<std::string, std::vector<std::string>> args) {
Logger::debug("Running graph args");

int n = 1000;
double p = .01;
Expand All @@ -54,7 +55,7 @@ void runGraph(std::map<std::string, std::vector<std::string>> args) {
Logger::error("Too many arguments for -p");
exit(1);
}
if (Utils::isNumber(pArgs[0])) {
if (Utils::isDouble(pArgs[0])) {
p = std::stod(pArgs[0]);
} else {
Logger::error("Argument for -p is not a number");
Expand Down
3 changes: 2 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "../include/Args.hpp"

int main(int argv, char **argc) {
// TODO add log everywhere (with log level)

// Convert argv to map
std::map<std::string, std::vector<std::string>> args;
Expand All @@ -27,7 +28,7 @@ int main(int argv, char **argc) {

Logger::debug("Graph v" + std::string(GRAPH_VERSION) + " started !");

runGraph(args);
runGraphArgs(args);

// List::Graph g(6);
//
Expand Down

0 comments on commit 145d847

Please sign in to comment.