server: Add command line options

Add four non-optional command line options for the server:
  namespace
    Instruct the server what dbus path namespaces to watch.
  interface_namespace
    Instruct the server which interfaces to watch.
  blacklist
    Instruct the server to ignore specific paths.
  interface blacklist
    Instruct the server to ignore specific interfaces.

Paths are checked before interfaces.  If a path does not match the
interface configuration does not matter.

Paths are first checked against the blacklist and then allowed if
the path contains the namespace or the namespace contains the path.

Interfaces are slightly different; the blacklist is checked as with
paths but then the interface is only allowed if it contains the namespace.

Resolves: openbmc/openbmc#1767

Change-Id: Ib83d5163681fc49114e4c86be177d11b8528322f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/phosphor-mapper b/phosphor-mapper
index 2f35daa..4e28c1c 100644
--- a/phosphor-mapper
+++ b/phosphor-mapper
@@ -18,6 +18,28 @@
 
 import sys
 import obmc.mapper.server
+from argparse import ArgumentParser
 
 if __name__ == '__main__':
-    sys.exit(obmc.mapper.server.server_main())
+    parser = ArgumentParser()
+    parser.add_argument(
+        '-p', '--path_namespaces',
+        required=True)
+    parser.add_argument(
+        '-i', '--interface_namespaces',
+        required=True)
+    parser.add_argument(
+        '-b', '--blacklists',
+        default="")
+    parser.add_argument(
+        '-n', '--interface_blacklists',
+        default="")
+
+    args = parser.parse_args()
+
+    sys.exit(
+        obmc.mapper.server.server_main(
+            path_namespaces=args.path_namespaces.split(),
+            interface_namespaces=args.interface_namespaces.split(),
+            blacklists=args.blacklists.split(),
+            interface_blacklists=args.interface_blacklists.split()))