2018-02-08 01:11:47 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
import sys
|
2018-02-13 22:03:03 +01:00
|
|
|
import os
|
2018-02-08 01:11:47 +01:00
|
|
|
|
2018-02-13 22:03:03 +01:00
|
|
|
if (len(sys.argv) < 3):
|
|
|
|
print("Howdy IR face recognition help")
|
2018-02-10 16:39:41 +01:00
|
|
|
import cli.help
|
|
|
|
sys.exit()
|
|
|
|
|
2018-02-13 22:03:03 +01:00
|
|
|
user = sys.argv[1]
|
|
|
|
cmd = sys.argv[2]
|
|
|
|
|
|
|
|
if cmd in ["list", "add", "remove", "clear"] and os.getenv("SUDO_USER") is None:
|
|
|
|
print("Please run this command with sudo")
|
|
|
|
sys.exit()
|
2018-02-08 01:11:47 +01:00
|
|
|
|
|
|
|
if cmd == "list":
|
2018-02-10 15:09:49 +01:00
|
|
|
import cli.list
|
2018-02-10 16:39:41 +01:00
|
|
|
elif cmd == "help":
|
2018-02-13 22:03:03 +01:00
|
|
|
print("Howdy IR face recognition")
|
2018-02-10 16:39:41 +01:00
|
|
|
import cli.help
|
|
|
|
elif cmd == "add":
|
|
|
|
import cli.add
|
2018-02-13 22:03:03 +01:00
|
|
|
elif cmd == "clear":
|
|
|
|
import cli.clear
|
|
|
|
else:
|
|
|
|
if sys.argv[1] in ["list", "add", "remove", "clear", "help"]:
|
|
|
|
print("Usage: howdy <user> <command>")
|
|
|
|
else:
|
|
|
|
print('Unknown command "' + cmd + '"')
|
|
|
|
import cli.help
|