The action positional argument now goes before the recipes. This will
make it easier for the bash completion scripts and it also makes more
sense to keep the variable part (list of recipes) at the end.
Signed-off-by: Radek Pazdera <rpazdera(a)redhat.com>
---
install/lnst-ctl.1.in | 2 +-
lnst-ctl | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/install/lnst-ctl.1.in b/install/lnst-ctl.1.in
index 61efe05..97a186b 100644
--- a/install/lnst-ctl.1.in
+++ b/install/lnst-ctl.1.in
@@ -12,7 +12,7 @@ lnst-ctl \- Linux Network Stack Test controller
.SH SYNOPSIS
.BR
.B lnst-ctl
-[\fIOPTION\fR]... \fIRECIPE\fR... \fIACTION\fR
+[\fIOPTION\fR]... \fIACTION\fR \fIRECIPE\fR...
.SH DESCRIPTION
Linux Network Stack Test is a tool that supports development and execution
of automated and portable network tests. For detailed description of the
diff --git a/lnst-ctl b/lnst-ctl
index 1ed9b2f..d597c23 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -31,7 +31,7 @@ def usage(retval=0):
"""
Print usage of this app
"""
- print "Usage: %s [OPTION...] [RECIPE...] ACTION" % sys.argv[0]
+ print "Usage: %s [OPTIONS...] ACTION [RECIPES...]" % sys.argv[0]
print ""
print "ACTION = [ run | config_only | match_setup ]"
print ""
@@ -192,7 +192,8 @@ def main():
logging.error("No action specified")
usage(RETVAL_ERR)
- action = args.pop()
+ action = args[0]
+ recipes = args[1:]
if not action in ['run', 'config_only', 'match_setup']:
logging.error("Action '%s' not recognised" % action)
usage(RETVAL_ERR)
@@ -201,7 +202,7 @@ def main():
retval = RETVAL_PASS
res_serializer = NetTestResultSerializer()
- for recipe_path in args:
+ for recipe_path in recipes:
if os.path.isdir(recipe_path):
all_files = []
for root, dirs, files in os.walk(recipe_path):
--
1.8.3.1