Commit 637f5ac1 authored by Arnaud Fontaine's avatar Arnaud Fontaine

Allow to specify the starting user index.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@45899 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 35f843aa
......@@ -89,6 +89,13 @@ def parseArguments(argv):
help='Repeat the benchmark suite N times '
'(default: infinite)')
parser.add_argument('--user-index',
type=int,
default=0,
metavar='INDEX',
help='Index of the first user within userInfo '
'(default: 0)')
# Mandatory arguments
parser.add_argument('url',
type=ArgumentType.ERP5UrlType,
......@@ -120,6 +127,7 @@ def parseArguments(argv):
max_nb_users = isinstance(namespace.users, tuple) and namespace.users[1] or \
namespace.users
namespace.user_tuple = namespace.user_tuple[namespace.user_index:]
if max_nb_users > len(namespace.user_tuple):
raise argparse.ArgumentTypeError("Not enough users in the given file")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment