diff --git a/etc/rally.bash_completion b/etc/rally.bash_completion index 8bb8ef0fc3..565c8040ec 100644 --- a/etc/rally.bash_completion +++ b/etc/rally.bash_completion @@ -50,8 +50,9 @@ _rally() for OPT in ${!OPTS[*]} ; do - CMDSUB=(${OPT//_/ }) - SUBCOMMANDS[${CMDSUB[0]}]+="${CMDSUB[1]} " + CMD=${OPT%%_*} + CMDSUB=${OPT#*_} + SUBCOMMANDS[${CMD}]+="${CMDSUB} " done COMMANDS="${!SUBCOMMANDS[*]}" diff --git a/rally/cmd/cliutils.py b/rally/cmd/cliutils.py index 4740cbb411..6f645bc646 100644 --- a/rally/cmd/cliutils.py +++ b/rally/cmd/cliutils.py @@ -445,8 +445,9 @@ _rally() %(data)s for OPT in ${!OPTS[*]} ; do - CMDSUB=(${OPT//_/ }) - SUBCOMMANDS[${CMDSUB[0]}]+="${CMDSUB[1]} " + CMD=${OPT%%%%_*} + CMDSUB=${OPT#*_} + SUBCOMMANDS[${CMD}]+="${CMDSUB} " done COMMANDS="${!SUBCOMMANDS[*]}" @@ -489,4 +490,4 @@ complete -F _rally rally completion.append(""" OPTS["{cat}_{cmd}"]="{args}"\n""".format( cat=category, cmd=name, args=args)) - return bash_data % {"data": "".join(sorted(completion))} \ No newline at end of file + return bash_data % {"data": "".join(sorted(completion))}