> > +   if (pemmode) {
> > +           if (pledge("stdio rpath", NULL) == -1)
> > +                   err(1, "pledge");
> > +
> > +           if (argc > 1)
> > +                   goto usage;
> 
> This should be argc > 0 to match your synopsis.

Ugh. I confused myself here, it was actually correct but a bit quirky.

I think it would be better to use "p:" in the getopt string and assign
the file argument to a new variable or do a loop over argv as indicated
below.

> 
> Or should this behave like file mode and accept an arbitrary number of
> file arguments? For example you could drop the argc check and do:
> 
>               for (i = 0; i < argc; i++) {
>                       if ((rc = print_pem(argv[i])) != 0)
>                               return rc
>               }

Reply via email to