Handle the "--version" argument when iterating on argc
This commit is contained in:
parent
6ce13be4ca
commit
82520e63ba
|
@ -10,7 +10,6 @@ using namespace std;
|
||||||
#include "headers/transpiler/Target.hpp"
|
#include "headers/transpiler/Target.hpp"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
if ((argc == 2) && (((string) argv[1]) == "--version")) { cout << Yerbacon::getVersion() << endl; exit(EXIT_SUCCESS); }
|
|
||||||
string target = ".lua";
|
string target = ".lua";
|
||||||
bool printResult = false;
|
bool printResult = false;
|
||||||
bool parallel = false;
|
bool parallel = false;
|
||||||
|
@ -21,7 +20,8 @@ int main(int argc, char* argv[]) {
|
||||||
for (signed int i = 0; i < argc; ++i)
|
for (signed int i = 0; i < argc; ++i)
|
||||||
{
|
{
|
||||||
const string_view currentArg (argv[i]);
|
const string_view currentArg (argv[i]);
|
||||||
if (currentArg == ArgumentShort("printresult")) printResult = true;
|
if ((argc == 2) && (currentArg == Argument("version"))) { cout << Yerbacon::getVersion() << endl; exit(EXIT_SUCCESS); }
|
||||||
|
else if (currentArg == ArgumentShort("printresult")) printResult = true;
|
||||||
else if (currentArg == ArgumentAssignable("target")) {
|
else if (currentArg == ArgumentAssignable("target")) {
|
||||||
const string value = ArgumentAssignable::getValueFor(currentArg.data());
|
const string value = ArgumentAssignable::getValueFor(currentArg.data());
|
||||||
if (!value.empty()) (target = '.') += value;
|
if (!value.empty()) (target = '.') += value;
|
||||||
|
|
Loading…
Reference in New Issue