From df168536ca1aaf0b147e67ef214bf35dfd34e441 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 30 May 2019 01:14:31 +0200 Subject: Cleanup, and rewrite cmdline + settings handling Command line parsing now uses QCommandLineXXX classes Old unused options have been removed, like the "pools" feature Closes #3599 --- src/command_line_options.cpp | 140 ------------------------------------------- 1 file changed, 140 deletions(-) delete mode 100644 src/command_line_options.cpp (limited to 'src/command_line_options.cpp') diff --git a/src/command_line_options.cpp b/src/command_line_options.cpp deleted file mode 100644 index fc4e0e1..0000000 --- a/src/command_line_options.cpp +++ /dev/null @@ -1,140 +0,0 @@ -#include "command_line_options.h" -#include -#include - - -CommandLineOptions::CommandLineOptions(int argc, char * const argv[]) { - // parse command line arguments (please sort by short option for easier handling) - static const struct option longOptions[] = { - {"allow-vm-edit", no_argument, nullptr, 'vmed'}, - {"autoquit", required_argument, nullptr, 'aqit'}, - {"base", required_argument, nullptr, 'b'}, - {"path", required_argument, nullptr, 'b'}, // Compatibility to v1.0 - {"config", required_argument, nullptr, 'c'}, - {"debug", no_argument, nullptr, 'D'}, - {"default", required_argument, nullptr, 'd'}, - {"exam-mode", no_argument, nullptr, 'exms'}, - {"fullscreen", no_argument, nullptr, 'F'}, - {"file", required_argument, nullptr, 'f'}, - {"help", no_argument, nullptr, 'h'}, - {"insecure", no_argument, nullptr, 'i'}, - {"locations", required_argument, nullptr, 'l'}, - {"pool", required_argument, nullptr, 'P'}, - {"pvs", no_argument, nullptr, 'p'}, - {"pvs-checked", no_argument, nullptr, 'pvck'}, - {"runscript", no_argument, nullptr, 'S'}, - {"size", required_argument, nullptr, 's'}, - {"tab", required_argument, nullptr, 'T'}, - {"theme", required_argument, nullptr, 't'}, - {"url", required_argument, nullptr, 'u'}, - {"url-list", required_argument, nullptr, 'ulst'}, - {"url-news", required_argument, nullptr, 'unws'}, - {"url-help", required_argument, nullptr, 'uhlp'}, - {"version", no_argument, nullptr, 'v'}, - {"xpath", required_argument, nullptr, 'x'}, - {"location-mode", required_argument, nullptr, 'locm'}, - {"template-mode", required_argument, nullptr, 'tmpm'}, - {"start-uuid", required_argument, nullptr, 'uuid'}, - {"no-vtx", no_argument, nullptr, 'nvtx'}, - {nullptr, 0, nullptr, 0} - }; - - int c; - - // Again, please sort alphabetically in getopt_long call and switch statement - while ((c = getopt_long(argc, argv, "b:c:Dd:Ff:hil:P:pSs:t:T:u:vx:?", longOptions, nullptr)) != -1) { - switch (c) { - case 'aqit': - options.insert("autoquit", optarg); - break; - case 'b': - options.insert("base", optarg); - break; - case 'c': - options.insert("config", optarg); - break; - case 'D': - options.insert("debugMode", "debugMode"); - break; - case 'd': - options.insert("default", optarg); - break; - case 'F': - options.insert("fullscreen", "fullscreen"); - break; - case 'exms': - options.insert("exam-mode", "yo"); - break; - case 'f': - options.insert("file", optarg); - break; - case 'h': - case '?': - options.insert("usage", "usage"); - break; - case 'i': - options.insert("insecure", "nossl"); - break; - case 'l': - options.insert("locations", optarg); - break; - case 'p': - options.insert("pvs", "pvs"); - break; - case 'pvck': - options.insert("pvs-checked", "pvs-checked"); - break; - case 'P': - options.insert("pool", optarg); - break; - case 'S': - options.insert("runscript", optarg); - break; - case 's': - options.insert("size", optarg); - break; - case 't': - options.insert("theme", optarg); - break; - case 'T': - options.insert("tab", optarg); - break; - case 'u': - options.insert("url", optarg); - break; - case 'v': - options.insert("version", "version"); - break; - case 'x': - options.insert("xpath", optarg); - break; - case 'locm': - options.insert("location-mode", optarg); - break; - case 'tmpm': - options.insert("template-mode", optarg); - break; - case 'nvtx': - options.insert("no-vtx", "no-vtx"); - break; - case 'ulst': - options.insert("url-list", optarg); - break; - case 'unws': - options.insert("url-news", optarg); - break; - case 'uhlp': - options.insert("url-help", optarg); - break; - case 'uuid': - options.insert("uuid", optarg); - break; - case 'vmed': - options.insert("allow-vm-edit", ""); - break; - default: - options.insert("error", "error"); - break; - } - } -} -- cgit v1.2.3-55-g7522