v2.c

Mon, 23 May 2011 16:43:13 +0200

author
Mike Becker <universe@uap-core.de>
date
Mon, 23 May 2011 16:43:13 +0200
changeset 1
34a5e235d16e
permissions
-rw-r--r--

cline version 2

#include "v2.h"
#include "include.h"

int checkArgument(const char* arg, const char* expected) {
  int len = strlen(expected);
  int ret = 0;

  if (arg[0] == '-') {
    if (arg[1] != '-') {
      for (int t = 0 ; t < len ; t++) {
        ret |= (strchr(arg, expected[t]) > 0) << t;
      }
    }
  }  

  return ret;
}

mercurial