GNU Hello/Blog
OK, I have finished patching the source to include this option. Here is the patch:
dean@cerulean:~/hello/src$ diff -w ~/hello.c hello.c
4c4
< 2006, 2007, 2008 Free Software Foundation, Inc.
---
> 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
31a32
> { "loop", no_argument, NULL, 'l' },
48c49
< int lose = 0;
---
> int lose = 0, loop = 0;
69c70
< while ((optc = getopt_long (argc, argv, "g:hntv", longopts, NULL)) != -1)
---
> while ((optc = getopt_long (argc, argv, "g:hntvl", longopts, NULL)) != -1)
90a92,94
> case 'l':
> loop = 1;
> break;
107a112,113
> do
> {
110d115
<
123d127
<
135c139
<
---
> } while(loop);
171c175,176
< -g, --greeting=TEXT use TEXT as the greeting message\n"), stdout);
---
> -g, --greeting=TEXT use TEXT as the greeting message\n\
> -l, --loop repeatedly display greeting message\n"), stdout);
202c207
< "2008");
---
> "2009");
Deanmen 01:18, 31 July 2009 (UTC)
Note: the new version of the help string should be also put in the po files for English or people won't know about the loop feature if they
have LANG=en_US instead of LANG=C. Requesting translations of modified help message into other languages so they can find out about this wonderful feature as well. Deanmen 01:24, 31 July 2009 (UTC)
Hmmm... texinfo and other documentation also needs change documented -- maybe should post unified diff? Deanmen 01:35, 31 July 2009 (UTC)
Emailed diff to author... waiting... Deanmen 14:31, 31 July 2009 (UTC)
Got email saying it duplicates the functionality of yes. Yeah, I guess it does. Deanmen 23:17, 6 August 2009 (UTC)