[krbdev.mit.edu #1510] kadmin arg parsing

Ken Raeburn via RT rt-comment at krbdev.mit.edu
Wed May 21 19:28:46 EDT 2003


IMNSHO, we should assume that anything starting with a "-" is likely
to be intended as an option and not a name.

kadmin:  ank -expire
WARNING: no policy specified for -expire at RAEBURN.ORG; defaulting to no policy
Enter password for principal "-expire at RAEBURN.ORG": 
[...]
kadmin:  ank --help
WARNING: no policy specified for --help at RAEBURN.ORG; defaulting to no policy
[...]

Yes, it's remotely possible someone might want to create a principal
name starting with a "-".  An option that means "the next argument is
the principal name, even if it starts with a dash" would take care of
that.  (And thus I set about reinventing some of the Multics argument
parsing conventions.  Hmm.)

Also, either "-help" or "--help" should be supported by all of the
kadmin commands.  If the response to an unknown "-" option is to print
out a usage message, without complaining that option X is unknown,
that would sort of happen automatically.  Complaining that "-help" is
unknown and then printing a usage message would be less optimal, but
would get the job done.

Ken


More information about the krb5-bugs mailing list