Skip to content

Commit

Permalink
converted UsingCommandLine to tristate, in preparation for code untan…
Browse files Browse the repository at this point in the history
…gling later
  • Loading branch information
Nicholas O'Connor committed Mar 24, 2016
1 parent a4a9ea0 commit 4930061
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Tilandis/Tilandis.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace Tilandis {
extern void PrintUsage(std::wstring);

// cmdline.cpp
extern bool UsingCommandLine(int argc, wchar_t* argv[]);
extern tristate UsingCommandLine(int argc, wchar_t* argv[]);
extern std::wstring LinkName;
extern std::wstring PathName;
extern std::wstring WorkingDirectory;
Expand Down
12 changes: 6 additions & 6 deletions Tilandis/cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ bool Tilandis::DeleteMode = false;
bool Tilandis::ForceLink = false;
bool Tilandis::LinkInAdminMode = false;

bool Tilandis::UsingCommandLine(int argc, wchar_t* argv[]) {
tristate Tilandis::UsingCommandLine(int argc, wchar_t* argv[]) {
if (argc < 3) { // 1 = "tilandis.exe", 2 = "tilandis.exe tilecreator:example"
return false;
return False;
}
else {
wchar_t curflag;
Expand All @@ -31,7 +31,7 @@ bool Tilandis::UsingCommandLine(int argc, wchar_t* argv[]) {
if (lookingforarg) {
if (curargstr[0] == L'-') {
throw Tilandis::Exceptions::MissingArg;
return false;
return False;
}

std::wstring resultarg = argv[curarg];
Expand Down Expand Up @@ -63,7 +63,7 @@ bool Tilandis::UsingCommandLine(int argc, wchar_t* argv[]) {
else {
if (curargstr[0] != L'-') {
throw Tilandis::Exceptions::MissingArg;
return false;
return False;
}
switch (curargstr[1]) {
case L'f':
Expand Down Expand Up @@ -99,10 +99,10 @@ bool Tilandis::UsingCommandLine(int argc, wchar_t* argv[]) {
default:
std::wcout << "Unrecognized argument: " << curargstr << std::endl;
Tilandis::PrintUsage(argv[0]);
return false;
return False;
}
}
}
}
return true; // If there was a problem it would have returned false by now
return False; // If there was a problem it would have returned false by now
}

0 comments on commit 4930061

Please sign in to comment.