handle --

This commit is contained in:
Connor Lane Smith
2011-05-24 11:05:36 +01:00
parent 8c76381e91
commit 4c6c379812
3 changed files with 13 additions and 9 deletions

View File

@@ -8,10 +8,12 @@ main(int argc, char *argv[])
{
unsigned int seconds;
if(argc != 2)
if(getopt(argc, argv, "") != -1)
exit(EXIT_FAILURE);
if(optind != argc-1)
eprintf("usage: %s seconds\n", argv[0]);
seconds = atoi(argv[1]);
seconds = atoi(argv[optind]);
while((seconds = sleep(seconds)) > 0)
;
return EXIT_SUCCESS;