added basic options handling
This commit is contained in:
parent
15dd4f6296
commit
495a7cf3cf
@ -3,16 +3,33 @@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "funcs.h"
|
||||
|
||||
int verbosity;
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
|
||||
int opt;
|
||||
|
||||
while ((opt = getopt(argc, argv, "v")) != -1) {
|
||||
switch (opt) {
|
||||
case 'v': verbosity++; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
|
||||
if (verbosity > 1)
|
||||
fprintf(stderr, "fake values - %s %s\n", __DATE__, __TIME__);
|
||||
|
||||
|
||||
|
||||
verbosity = 1;
|
||||
printf("%f %d\n", dtime(), random1000(0));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------------- */
|
||||
|
Loading…
Reference in New Issue
Block a user