Add 3rdparty getopt for MSVC

This commit is contained in:
Jonas Kvinge
2022-02-06 16:55:11 +01:00
parent 3730bd04a4
commit a1735278df
6 changed files with 674 additions and 7 deletions

View File

@@ -22,9 +22,7 @@
#include "version.h"
#include <cstdlib>
#ifndef _MSC_VER
# include <getopt.h>
#endif
#include <getopt.h>
#include <iostream>
#include <type_traits>
@@ -121,7 +119,6 @@ void CommandlineOptions::RemoveArg(const QString &starts_with, int count) {
bool CommandlineOptions::Parse() {
#ifndef _MSC_VER // TODO: Consider QCommandLineOption.
static const struct option kOptions[] = {
{"help", no_argument, nullptr, 'h'},
{"play", no_argument, nullptr, 'p'},
@@ -322,8 +319,6 @@ bool CommandlineOptions::Parse() {
}
}
#endif // _MSC_VER
return true;
}