4 * Written by Donald Barnes <djb@redhat.com> for Red Hat, Inc.
6 * Copyright (c) 1997-2003 Red Hat, Inc. All rights reserved.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License, version 2,
10 * as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
31 int main(int argc, char **argv) {
37 char * countStr = NULL;
38 struct poptOption options[] = {
39 { "version", 'v', POPT_ARG_NONE, &showVersion, 0,
40 "Display the version of this program, and exit" },
41 { "oot", 'o', POPT_ARG_NONE, &showOot, 0,
47 optCon = poptGetContext("usleep", argc, argv, options,0);
48 /*poptReadDefaultConfig(optCon, 1);*/
49 poptSetOtherOptionHelp(optCon, "[microseconds]");
51 if ((rc = poptGetNextOpt(optCon)) < -1) {
52 fprintf(stderr, "usleep: bad argument %s: %s\n",
53 poptBadOption(optCon, POPT_BADOPTION_NOALIAS),
59 printf("usleep version 1.2\n usleep --help for more info\n");
64 printf("oot says hey!\n");
68 countStr = poptGetArg(optCon);
70 if (countStr == NULL) count = 1;
72 else if (countStr && poptGetArg(optCon)) {
73 fprintf(stderr, "%s: exactly one argument (number of microseconds) "
74 "must be used\n", argv[0]);
78 else count = strtoul(countStr, NULL, 0);