diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2013-09-13 17:23:10 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2013-09-13 17:41:53 +0200 |
commit | 32b3b3243f5ef16c241f708d950964466af4e038 (patch) | |
tree | 628891dd47d54ccb42221288cbdb99ee55b7d1f9 /utils | |
parent | e7d0b5560fcc36d4f0592799dfa57b09113f9caf (diff) | |
download | external_libqmi-32b3b3243f5ef16c241f708d950964466af4e038.zip external_libqmi-32b3b3243f5ef16c241f708d950964466af4e038.tar.gz external_libqmi-32b3b3243f5ef16c241f708d950964466af4e038.tar.bz2 |
qmi-network: implement --help and --version
Diffstat (limited to 'utils')
-rw-r--r-- | utils/Makefile.am | 10 | ||||
-rwxr-xr-x | utils/qmi-network.in (renamed from utils/qmi-network) | 35 |
2 files changed, 43 insertions, 2 deletions
diff --git a/utils/Makefile.am b/utils/Makefile.am index 5d4ffa3..4145418 100644 --- a/utils/Makefile.am +++ b/utils/Makefile.am @@ -1,2 +1,10 @@ -dist_bin_SCRIPTS = qmi-network +bin_SCRIPTS = qmi-network + +qmi-network: qmi-network.in + $(AM_V_GEN) sed -e s,@VERSION\@,$(VERSION), $< > $@.tmp && mv $@.tmp $@ + @chmod a+x $@ + +EXTRA_DIST = qmi-network.in + +CLEANFILES = qmi-network diff --git a/utils/qmi-network b/utils/qmi-network.in index 89b1fc4..2bef24a 100755 --- a/utils/qmi-network +++ b/utils/qmi-network.in @@ -14,14 +14,47 @@ # this program; if not, write to the Free Software Foundation, Inc., 51 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -# Copyright (C) 2012 Aleksander Morgado <aleksander@gnu.org> +# Copyright (C) 2012-2013 Aleksander Morgado <aleksander@gnu.org> print_usage () { echo "usage: $0 [DEVICE] [COMMAND]" } +help () +{ + echo "Usage: qmi-network [OPTIONS] [DEVICE] [COMMAND] - Simple network management of QMI devices" + echo + echo "Commands:" + echo " start Start network connection" + echo " stop Stop network connection" + echo " status Query network connection status" + echo + echo "Options:" + echo " --help Show help options" + echo " --version Show version" + echo +} + +version () +{ + echo "qmi-network @VERSION@" + echo "Copyright (2013) Aleksander Morgado" + echo "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl-2.0.html>" + echo "This is free software: you are free to change and redistribute it." + echo "There is NO WARRANTY, to the extent permitted by law." + echo +} + if [ $# -ne 2 ]; then + if [ $1 == "--help" ]; then + help + exit 0 + elif [ $1 == "--version" ]; then + version + exit 0 + fi + echo "error: missing arguments" 1>&2 print_usage exit 255 |