On 21/03/10 16:16, Kim Hansen wrote: > When testing the --kill-after I found the following strange behaviour: > k...@raph:~$ timeout --help --help > timeout: unrecognized option '--help' > Try `timeout --help' for more information. > k...@raph:~$ > > It looks like parse_long_options() only will give help or version if > that is the only option passed to the program, the following change > made the program behave like I expected it to do:
Well all of the following have that behavior: $ grep -l parse_long_options *.c | sed 's/.c$//' | fmt basename chroot cksum dd dirname echo expr getlimits hostid hostname link logname nice nohup printf setuidgid sleep sync test timeout tsort unlink uptime users whoami yes The reason is that parse_long_options() only parses options when there is a single option passed to the command. It does this on purpose so as not to effect options that may be passed on to further commands or requiring users to specially mark such options. cheers, Pádraig.
