diff --git a/network_control.sh b/network_control.sh index 09080a7..db502a4 100755 --- a/network_control.sh +++ b/network_control.sh @@ -1,7 +1,7 @@ - +#!/bin/sh # Script which control the network. Make the bridge, veth, dummy, brx alone without any help. -version="0.0.1" +version="0.0.2" usage="USAGE $(basename $0) [PARAMETTER] [COMMAND NAME] @@ -16,7 +16,8 @@ DESCRIPTION PARAMETTER -h, --help Print this help message and quit - -v, --version Print the installed version of $(basename $0) and quit + -V, --version Print the installed version of $(basename $0) and quit + -v, --verbose Print more output for all actions. NAME Is the name of the vm to open @@ -28,6 +29,29 @@ COMMAND " -echo "$usage" +print_usage() { + echo "${usage}" +} + +print_version() { + echo "$(basename $0) v.${version}" +} + +# first, test if there is help, version, or verbose args. +for i in "$@"; do + case "$i" in + "-h" | "--help") + print_usage + exit 0 + ;; + "-V" | "--version") + print_version + exit 0 + ;; + "-v" | "--verbose") + set_verbose + ;; + esac +done