1
0
mirror of https://github.com/ScrelliCopter/tmx2gba.git synced 2025-02-21 03:29:25 +11:00

Give up on implementation specific getopt and just use a known competent one

This commit is contained in:
2019-05-13 23:57:44 +10:00
parent 5baf96d021
commit 45dff8f3f6
5 changed files with 934 additions and 45 deletions

View File

@@ -31,12 +31,8 @@
#include <string>
#include <cstdint>
#include <algorithm>
#include <ultragetopt.h>
#ifdef _MSC_VER
#include <XGetopt.h>
#else
#include <getopt.h>
#endif
using std::cout;
using std::cerr;
@@ -77,22 +73,10 @@ struct SParams
bool objExport = false;
};
void GetoptClear ()
{
#ifdef _MSC_VER
optarg = nullptr;
optind = 0;
next = nullptr;
#else
optreset = 1;
optind = 1;
#endif
}
void ParseArgs ( int argc, char** argv, SParams* params )
{
char cOption;
GetoptClear ();
optreset = 1;
while ( ( cOption = (char)getopt ( argc, argv, "hr:l:c:p:y:m:i:o:f:" ) ) > 0 )
{
switch ( cOption )