mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2025-08-18 01:15:59 +00:00
Error message when specifying unused mapping
This commit is contained in:
parent
f99ba40cc9
commit
d71d238a19
10
src/main.c
10
src/main.c
@ -178,6 +178,8 @@ int main(int argc, char* argv[]) {
|
||||
int option_index = 0;
|
||||
bool sops = true;
|
||||
bool localaudio = false;
|
||||
bool inputAdded = false;
|
||||
bool mapped = true;
|
||||
int c;
|
||||
while ((c = getopt_long_only(argc, argv, "-abc:d:efg:h:i:j:k:lm:n", long_options, &option_index)) != -1) {
|
||||
switch (c) {
|
||||
@ -212,6 +214,8 @@ int main(int argc, char* argv[]) {
|
||||
break;
|
||||
case 'j':
|
||||
input_create(optarg, mapping);
|
||||
inputAdded = true;
|
||||
mapped = true;
|
||||
break;
|
||||
case 'k':
|
||||
mapping = get_path(optarg);
|
||||
@ -219,6 +223,7 @@ int main(int argc, char* argv[]) {
|
||||
fprintf(stderr, "Unable to open custom mapping file: %s\n", optarg);
|
||||
exit(-1);
|
||||
}
|
||||
mapped = false;
|
||||
break;
|
||||
case 'l':
|
||||
sops = false;
|
||||
@ -241,6 +246,11 @@ int main(int argc, char* argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (inputAdded && !mapped) {
|
||||
fprintf(stderr, "Mapping option should be followed by the input to be mapped.\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (action == NULL || strcmp("help", action) == 0)
|
||||
help();
|
||||
else if (strcmp("map", action) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user