Simlifies while cycle to for cycle in docopt function