Fix command line tool to set the right privacy enum.
Test: manual
Change-Id: I3f0845ea32b46f1a028f8b6d3d4180a90a47beb5
diff --git a/cmds/incident/main.cpp b/cmds/incident/main.cpp
index 519852d..cdec6a0 100644
--- a/cmds/incident/main.cpp
+++ b/cmds/incident/main.cpp
@@ -148,9 +148,19 @@
static int
get_dest(const char* arg)
{
- if (strcmp(arg, "LOCAL") == 0) return 0;
- if (strcmp(arg, "EXPLICIT") == 0) return 1;
- if (strcmp(arg, "AUTOMATIC") == 0) return 2;
+ if (strcmp(arg, "L") == 0
+ || strcmp(arg, "LOCAL") == 0) {
+ return DEST_LOCAL;
+ }
+ if (strcmp(arg, "E") == 0
+ || strcmp(arg, "EXPLICIT") == 0) {
+ return DEST_EXPLICIT;
+ }
+ if (strcmp(arg, "A") == 0
+ || strcmp(arg, "AUTO") == 0
+ || strcmp(arg, "AUTOMATIC") == 0) {
+ return DEST_AUTOMATIC;
+ }
return -1; // return the default value
}