getopt.c
00001 #include <getopt.h>
00002 #include <stdio.h>
00003 #include <stdlib.h>
00004
00005 int main(int argc, char * argv[])
00006 {
00007 extern char *optarg;
00008 extern int optind;
00009 char c;
00010
00011 while ((c = getopt(argc, argv, "gc:o:")) != -1) {
00012 switch(c) {
00013 case 'g':
00014 break;
00015 case 'c':
00016 break;
00017 case 'o':
00018 break;
00019 default :
00020 printf("option non reconnue!\n");
00021 return EXIT_FAILURE;
00022 }
00023 }
00024
00025
00026
00027
00028
00029
00030 return 0;
00031 }