From 1fb94e83efab2557ca02abf264f96f51f566b103 Mon Sep 17 00:00:00 2001 From: Kiritow <1362050620@qq.com> Date: Fri, 18 Mar 2022 21:22:50 +0000 Subject: [PATCH] Add more command line options --- generate.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/generate.py b/generate.py index 5cda0cf..9f95d9e 100644 --- a/generate.py +++ b/generate.py @@ -1,3 +1,4 @@ +from ast import parse import os import sys import getopt @@ -5,7 +6,7 @@ from libwgopparser import Parser, errprint if __name__ == "__main__": - opts, args = getopt.getopt(sys.argv[1:], 'hiko:', ["tmux"]) + opts, args = getopt.getopt(sys.argv[1:], 'hiko:', ["tmux", "systemd"]) opts = {p[0]: p[1] for p in opts} if '-h' in opts: @@ -14,7 +15,8 @@ OPTIONS -h Display this help and quit. -k Output generated config to standard output -o Output generated config to file. Default is {source_filename}.gen - --tmux Use tmux instead of containers + --tmux Use tmux mode + --systemd Use systemd mode HELP For latest help please view https://github.com/Kiritow/wg-ops ''') @@ -33,6 +35,8 @@ HELP parser.opt_source_path = filepath if '--tmux' in opts: parser.opt_use_tmux = True + if '--systemd' in opts: + parser.opt_use_systemd = True parser.parse(content) parser.compile_interface()