
#include <string.h>

char	*optarg;
int	optind;

int getopt(int argc, char *argv[], char*format){
  int returnvalue;
  static int current=0;
  current++;
  while((current<argc)&&(argv[current][0]!='-'))current++;
  if(current>=argc)return -1;
  returnvalue=argv[current][1];
  current++;
  optarg=strdup(argv[current]);
/*  curr++;*/
  return returnvalue;
}
