add --access flag for debugging
This commit is contained in:
parent
5d0795dbd0
commit
2cacbfe27f
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
struct Args {
|
struct Args {
|
||||||
int debugLog = 0; // cast to bool later
|
int debugLog = 0; // cast to bool later
|
||||||
|
int access = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
Args parseArgs(int argc, char** argv);
|
Args parseArgs(int argc, char** argv);
|
||||||
|
|
|
@ -9,6 +9,7 @@ Args parseArgs(int argc, char** argv) {
|
||||||
while (1) {
|
while (1) {
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"debug-log", no_argument, &a.debugLog, 1},
|
{"debug-log", no_argument, &a.debugLog, 1},
|
||||||
|
{"access", no_argument, &a.access, 1},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
/* getopt_long stores the option index here. */
|
/* getopt_long stores the option index here. */
|
||||||
|
|
|
@ -32,6 +32,12 @@ int main(int argc, char** argv) {
|
||||||
qInfo() << "Hello, World!";
|
qInfo() << "Hello, World!";
|
||||||
qInfo() << "Using Locale: " << QLocale().name();
|
qInfo() << "Using Locale: " << QLocale().name();
|
||||||
|
|
||||||
|
if(args.access) {
|
||||||
|
auto access = ClientAccess::find();
|
||||||
|
qInfo() << "Access: port=" << access->getPort() << " basicAuth=" << access->getBasicAuth();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
QTranslator translator;
|
QTranslator translator;
|
||||||
if(translator.load(QLocale().name(), ":/i18n")) {
|
if(translator.load(QLocale().name(), ":/i18n")) {
|
||||||
|
|
Loading…
Reference in New Issue