diff options
-rwxr-xr-x | mknet (renamed from main.py) | 11 | ||||
-rw-r--r-- | setup.py | 6 |
2 files changed, 12 insertions, 5 deletions
@@ -345,11 +345,12 @@ def destroy(): if __name__ == "__main__": if len(sys.argv) < 2: - print("""Usage: - mk-testnet create [config_path] # create a new network. config_path defailt to config.yml - mk-testnet run-all <cmd> [args...] # run a command as each host. set the IP, NAME and ZONE environment variables - mk-testnet run <name> [cmd [args...]] # run command in host named <name>. Use zonename:name if multiple zones hosts server with same name. If cmd is empty, run a shell - mk-testnet destroy # destroy the current environment""") + progname = os.path.basename(sys.argv[0]) if len(sys.argv) > 0 else "mknet" + print(f"""Usage: + {progname} create [config_path] # create a new network. config_path defailt to config.yml + {progname} run-all <cmd> [args...] # run a command as each host. set the IP, NAME and ZONE environment variables + {progname} run <name> [cmd [args...]] # run command in host named <name>. Use zonename:name if multiple zones hosts server with same name. If cmd is empty, run a shell + {progname} destroy # destroy the current environment""") exit() cmd = sys.argv[1] if cmd == "create": diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..fda29c5 --- /dev/null +++ b/setup.py @@ -0,0 +1,6 @@ +from distutils.core import setup +setup(name='mknet', + version='1.0', + scripts=['mknet'], + py_modules=['net'], + ) |