Compare commits
5 commits
arguments-
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
4ec19688b2 | ||
c2d478f4c0 | |||
|
3a4ce3dab7 | ||
|
214f2ae235 | ||
|
dc8c77e51c |
1 changed files with 12 additions and 12 deletions
24
Src/blog.cpp
24
Src/blog.cpp
|
@ -34,8 +34,8 @@ std::string getArgValue(int argc, char* argv[], std::string argIdString)
|
||||||
if (strncmp(argId, argv[i], idValSplit) == 0)
|
if (strncmp(argId, argv[i], idValSplit) == 0)
|
||||||
return std::string(argv[i]).substr(idValSplit+1, strlen(argv[i])-(idValSplit+1));
|
return std::string(argv[i]).substr(idValSplit+1, strlen(argv[i])-(idValSplit+1));
|
||||||
}
|
}
|
||||||
printf("Missing argument! %s", argIdString); //the program exists if the value is 0
|
printf("Missing argument! %s", argIdString);
|
||||||
return std::string("")
|
return std::string("");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool doesArgExist(int argc, char* argv[], std::string argIdString)
|
bool doesArgExist(int argc, char* argv[], std::string argIdString)
|
||||||
|
@ -55,15 +55,6 @@ void copyFolderAndContents(std::string inUrl, std::string outUrl)
|
||||||
std::filesystem::copy(inUrl, outUrl, opts);
|
std::filesystem::copy(inUrl, outUrl, opts);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkForEmptyArguments()
|
|
||||||
{
|
|
||||||
// I hate doing it like this
|
|
||||||
if (source.empty() || output.empty() || stat.empty() || siteWebUrl.empty() || blogTemplate.empty() || atomTemplate.empty())
|
|
||||||
{
|
|
||||||
exit(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* -in="" // give source folder
|
* -in="" // give source folder
|
||||||
* -out="" // give output folder
|
* -out="" // give output folder
|
||||||
|
@ -79,7 +70,16 @@ int main(int argc, char* argv[])
|
||||||
std::string blogTemplate = getArgValue(argc, argv, "-blogTemplate=");
|
std::string blogTemplate = getArgValue(argc, argv, "-blogTemplate=");
|
||||||
std::string atomTemplate = getArgValue(argc, argv, "-atomTemplate=");
|
std::string atomTemplate = getArgValue(argc, argv, "-atomTemplate=");
|
||||||
|
|
||||||
checkForEmptyArguments()
|
// I hate doing it like this
|
||||||
|
if (source.empty() ||
|
||||||
|
output.empty() ||
|
||||||
|
stat.empty() ||
|
||||||
|
siteWebUrl.empty() ||
|
||||||
|
blogTemplate.empty() ||
|
||||||
|
atomTemplate.empty())
|
||||||
|
{
|
||||||
|
exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
int flags = OptionFlags::NONE;
|
int flags = OptionFlags::NONE;
|
||||||
if (doesArgExist(argc, argv, "-hide"))
|
if (doesArgExist(argc, argv, "-hide"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue