implement =maybe

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2450 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-07-19 00:42:23 +00:00
parent 956c6cccde
commit c1e4dfeb1a

View File

@@ -195,6 +195,8 @@ arg_match_long(struct getargs *args, size_t num_args,
strcmp(optarg + 1, "true") == 0){
*flag = !negate;
return 0;
} else if (*optarg && strcmp(optarg + 1, "maybe") == 0) {
*flag = rand() & 1;
} else {
*flag = negate;
return 0;
@@ -212,6 +214,8 @@ getarg(struct getargs *args, size_t num_args,
{
int i, j, k;
int ret = 0;
srand (time(NULL));
(*optind)++;
for(i = *optind; i < argc; i++) {
if(argv[i][0] != '-')