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()