git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] bash-completion: fix getting strategy list

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Aug 19, 2008, 14:57 UTC
Message-ID
<48AADF3E.40304@viscovery.net>
In-Reply-To
<48AADDBB.1080203@viscovery.net>
Johannes Sixt schrieb:
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");
-- Hannes
Previous: Johannes SixtNext: Nguyen Thai Ngoc Duy
Message 7 of 16 in “[BUG] git completion do sed on binary file”
  1. Nguyen Thai Ngoc DuyAug 19, 2008
  2. bash-completion: fix getting strategy listNguyen Thai Ngoc Duy, Aug 19, 2008
  3. Matthieu MoyAug 19, 2008
  4. Nguyen Thai Ngoc DuyAug 19, 2008
  5. Shawn O. PearceAug 19, 2008
  6. Johannes SixtAug 19, 2008
  7. Johannes SixtAug 19, 2008
  8. Nguyen Thai Ngoc DuyAug 20, 2008
  9. Junio C HamanoAug 20, 2008
  10. Junio C HamanoAug 20, 2008
  11. Miklos VajnaAug 20, 2008
  12. Nguyen Thai Ngoc DuyAug 21, 2008
  13. Mikael MagnussonAug 21, 2008
  14. Junio C HamanoAug 21, 2008
  15. Junio C HamanoAug 21, 2008
  16. Miklos VajnaAug 21, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.