implement =maybe
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2450 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -195,6 +195,8 @@ arg_match_long(struct getargs *args, size_t num_args,
|
|||||||
strcmp(optarg + 1, "true") == 0){
|
strcmp(optarg + 1, "true") == 0){
|
||||||
*flag = !negate;
|
*flag = !negate;
|
||||||
return 0;
|
return 0;
|
||||||
|
} else if (*optarg && strcmp(optarg + 1, "maybe") == 0) {
|
||||||
|
*flag = rand() & 1;
|
||||||
} else {
|
} else {
|
||||||
*flag = negate;
|
*flag = negate;
|
||||||
return 0;
|
return 0;
|
||||||
@@ -212,6 +214,8 @@ getarg(struct getargs *args, size_t num_args,
|
|||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
|
srand (time(NULL));
|
||||||
(*optind)++;
|
(*optind)++;
|
||||||
for(i = *optind; i < argc; i++) {
|
for(i = *optind; i < argc; i++) {
|
||||||
if(argv[i][0] != '-')
|
if(argv[i][0] != '-')
|
||||||
|
Reference in New Issue
Block a user