aboutsummaryrefslogtreecommitdiffstats
path: root/service/src/main.c
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-05-18 14:45:50 +0200
committerLouis Burda <quent.burda@gmail.com>2021-05-18 14:46:23 +0200
commit452885a387b3a1613defa378cee79eb97e7b4fc8 (patch)
treed226bd9ffe720925fea752ea7b0d76c04ad4cdbc /service/src/main.c
parentdafdcc3547ec786fac85486cbb77909fffe1a4de (diff)
downloadenowars5-service-stldoctor-452885a387b3a1613defa378cee79eb97e7b4fc8.tar.gz
enowars5-service-stldoctor-452885a387b3a1613defa378cee79eb97e7b4fc8.zip
seperated modelname and solidname handling
Diffstat (limited to 'service/src/main.c')
-rw-r--r--service/src/main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/service/src/main.c b/service/src/main.c
index 1e549c9..095eb7d 100644
--- a/service/src/main.c
+++ b/service/src/main.c
@@ -154,10 +154,15 @@ query_cmd(char *arg)
FILE *f = NULL;
size_t size;
- if (cached.valid)
+ if (arg && !strcmp(arg, "last")) {
+ if (!cached.valid) {
+ fprintf(stderr, "No cached info report available\n");
+ return;
+ }
hash = cached.hash;
- else
- hash = mhash(ask("> What is the model name? "), -1);
+ } else {
+ hash = mhash(ask("> Model name: "), -1);
+ }
if (!(d = opendir(resultdir))) return;