Re: enforce zero options

2016-10-12 Thread Joerg Sonnenberger
On Wed, Oct 12, 2016 at 03:53:17PM +0200, Jan Stary wrote: > I don't get it: why do we need to handle -- > in utils which take no options and no arguments? Are you sure they will never handle options in the future? Joerg

Re: enforce zero options

2016-10-12 Thread Jan Stary
On Oct 12 15:00:23, j...@wxcvbn.org wrote: > Jan Stary writes: > > > Some programs in bin/ and usr.bin/ use the following idiom > > to make sure that there are no options present: > > > > while ((ch = getopt(argc, argv, "")) != -1) > > switch (ch) { > >

Re: enforce zero options

2016-10-12 Thread Jeremie Courreges-Anglas
Jan Stary writes: > Some programs in bin/ and usr.bin/ use the following idiom > to make sure that there are no options present: > > while ((ch = getopt(argc, argv, "")) != -1) > switch (ch) { > case '?': > default: >

enforce zero options

2016-10-12 Thread Jan Stary
Some programs in bin/ and usr.bin/ use the following idiom to make sure that there are no options present: while ((ch = getopt(argc, argv, "")) != -1) switch (ch) { case '?': default: usage();