openwebrx-clone/owrxadmin/__main__.py
2021-02-06 18:15:02 +01:00

23 lines
783 B
Python

from owrx.version import openwebrx_version
from owrxadmin.commands import NewUser, DeleteUser
import argparse
import sys
def main():
print("OpenWebRX admin version {version}".format(version=openwebrx_version))
parser = argparse.ArgumentParser()
parser.add_argument("command", help="One of the following commands: adduser, removeuser")
parser.add_argument("--noninteractive", action="store_true", help="Don't ask for any user input (useful for automation)")
parser.add_argument("-u", "--user")
args = parser.parse_args()
if args.command == "adduser":
NewUser().run(args)
elif args.command == "removeuser":
DeleteUser().run(args)
else:
print("Unknown command: {command}".format(command=args.command))
sys.exit(1)