Error message for incorrect FQNames.
Given this FQName in a file:
@2.1::IComposerClient::Command
Which should be:
@2.1::IComposerClient.Command
The lexer reads in FQName objects. Before, the lexer was parsing
the following tokens:
'@2.1::IComposerClient' ':' ':' 'Command'
as
Interface FQName, invalid character, invalid character, identifier
Before:
ERROR: Invalid enum storage type specified. at ...
Now we get this error message (with only one token):
ERROR: FQName '@2.1::IComposerClient::Command' is not valid at ...
We do this by having the lexer accept a superset of valid FQNames which
FQName itself later can't parse.
- also added better error for enum invalid type errors
- also added error when hidl-gen is invoked with no fqnames
Test: check all interfaces with hidl-gen
Fixes: 62721248
Change-Id: I7f27d60a2026f026315e426febba9483d468e29a
diff --git a/main.cpp b/main.cpp
index 7c529a9..b7d5a96 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1367,6 +1367,12 @@
argc -= optind;
argv += optind;
+ if (argc == 0) {
+ fprintf(stderr, "ERROR: no fqname specified.\n");
+ usage(me);
+ exit(1);
+ }
+
if (rootPath.empty()) {
const char *ANDROID_BUILD_TOP = getenv("ANDROID_BUILD_TOP");