- if (argc<2 || argv[1][0]=='-') {
- fprintf(stderr,"authbind: usage: authbind program arg arg ...\n %s\n",rcsid);
- exit(-1);
+ depth= 1;
+ while (argc>1 && argv[1][0]=='-') {
+ argc--; argv++;
+ if (!argv[0][1]) break;
+ if (!strcmp("--deep",argv[0])) { depth= -1; }
+ else if (!strcmp("--depth",argv[0])) {
+ if (argc<=1) usageerror("--depth requires a value");
+ argc--; argv++;
+ depth= strtoul(argv[0],&ep,10);
+ if (*ep || depth<=0 || depth>100) usageerror("--depth value is not valid");
+ } else if (!strcmp("--help",argv[0]) || !strcmp("--help",argv[0])) {
+ printusage(stdout);
+ exit(0);
+ }