Re: [PATCH] bash-completion: fix getting strategy list
Show 9 quoted lines
> Nguyen Thai Ngoc Duy schrieb:
>> + if (argc == 2 && !strcmp(argv[1], "--show-strategies")) {
>> + for (i = 0; i < ARRAY_SIZE(all_strategy); i++)
>> + printf("%s\n", all_strategy[i].name);
>> + return 0;
>
> Improved error checking, but quick and dirty:
>
> + if (!strcmp(argv[1], "--show-strategies")) {Oops, not really improved. This still needs to check for argc >= 2.
Show 5 quoted lines
> + for (i = 0; i < ARRAY_SIZE(all_strategy); i++)
> + printf("%s\n", all_strategy[i].name);
> + return argc == 2 ? 0 :
> + error("--show-strategies does not take "
> + "any arguments");