summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-11-14 19:22:14 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-03 13:26:55 -0800
commit25d7c58c07fc4b0bf3bc188f540a4ac66f6cd233 (patch)
tree001306735dd20297fb03181decac648c8fb313c2 /core
parent5a8db978198682734cdecc69a480d21a16775d4a (diff)
downloadsubsurface-25d7c58c07fc4b0bf3bc188f540a4ac66f6cd233.tar.gz
downloader: first step to get instructions via CLI
This still doesn't do a thing, but at least it seems to get the information closer to where we want it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r--core/subsurfacestartup.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/subsurfacestartup.c b/core/subsurfacestartup.c
index c12357cbc..0b8385616 100644
--- a/core/subsurfacestartup.c
+++ b/core/subsurfacestartup.c
@@ -189,6 +189,10 @@ static void print_help()
printf("\n --user=<test> Choose configuration space for user <test>");
#ifdef SUBSURFACE_MOBILE_DESKTOP
printf("\n --testqml=<dir> Use QML files from <dir> instead of QML resources");
+#elif SUBSURFACE_DOWNLOADER
+ printf("\n --dc-vendor=vendor Set the dive computer to download from");
+ printf("\n --dc-product=product Set the dive computer to download from");
+ printf("\n --device=device Set the device to download from");
#endif
printf("\n --cloud-timeout=<nr> Set timeout for cloud connection (0 < timeout < 60)\n\n");
}
@@ -248,7 +252,20 @@ void parse_argument(const char *arg)
++force_root;
return;
}
-#ifdef SUBSURFACE_MOBILE_DESKTOP
+#if SUBSURFACE_DOWNLOADER
+ if (strncmp(arg, "--dc-vendor=", sizeof("--dc-vendor=") - 1) == 0) {
+ prefs.dive_computer.vendor = strdup(arg + sizeof("--dc-vendor=") - 1);
+ return;
+ }
+ if (strncmp(arg, "--dc-product=", sizeof("--dc-product=") - 1) == 0) {
+ prefs.dive_computer.product = strdup(arg + sizeof("--dc-product=") - 1);
+ return;
+ }
+ if (strncmp(arg, "--device=", sizeof("--device=") - 1) == 0) {
+ prefs.dive_computer.device = strdup(arg + sizeof("--device=") - 1);
+ return;
+ }
+#elif SUBSURFACE_MOBILE_DESKTOP
if (strncmp(arg, "--testqml=", sizeof("--testqml=") - 1) == 0) {
testqml = malloc(strlen(arg) - sizeof("--testqml=") + 1);
strcpy(testqml, arg + sizeof("--testqml=") - 1);