def get_choices(ctx, args_, incomplete): args = config.commandline_profile.get_settings("parameters")[ctx.command.path][:] while args and args[0].startswith("-"): a = args.pop(0) if args and (a == "-r" or a == "--recipe"): args.pop(0) if not args: choices = compute_choices(ctx, args_, incomplete) else: path = args.pop(0).split(".") args = path + args ctx = get_ctx(path) choices = compute_choices(ctx, args, incomplete) for item, help in choices: yield (item, help)
def get_choices(ctx, args_, incomplete): args = config.commandline_profile.get_settings("parameters")[ctx.command.path][:] while args and args[0].startswith("-"): a = args.pop(0) if args and (a == "-r" or a == "--recipe"): args.pop(0) if not args: choices = compute_choices(ctx, args_, incomplete) else: args.pop(0) while ',' in args: args = args[args.index(',')+1:] ctx = get_ctx(args, side_effects=True) choices = compute_choices(ctx, args, incomplete) for item, help in choices: yield (item, help)