Make bin/xenu-nntp-server includeable

This commit is contained in:
XANTRONIX Development 2025-01-05 00:15:24 -05:00
parent a13002b9f0
commit 93f89bc7d6

View file

@ -7,6 +7,7 @@ from xenu_nntp.config import Config
from xenu_nntp.server import Server
from xenu_nntp.daemon import Daemon
def main():
parser = argparse.ArgumentParser(description='Tiny NNTP server')
parser.add_argument('--daemon', '-d', action='store_true', help='Run NNTP server as daemon in background')
parser.add_argument('--config-file', '-f', type=str, help='Specify a configuration file location')
@ -23,3 +24,6 @@ try:
server.run()
except KeyboardInterrupt:
server.stop()
if __name__ == '__main__':
exit(main())