есть такой код на c++
#include <getopt.h>
//пропуск
const char* short_opt = "nAR";
const struct option long_options[] = {
        {"num-updates",         0,  NULL,   'n'},
       {"auto-update",         1,  NULL,   'A'},
       {"retry-interval",      1,  NULL,   'R'},
        {NULL,              0,  NULL,   0}
 };
 do { 
        opt = getopt_long (argc,argv, short_opt, long_options, &i);
        switch (opt){
case 'n':
            //пропуск
            break;
case 'A':
         printf ("%s", getopt);
        break;
  } while (opt != -1);
при использовании myprog -A blah переменная getopt равна NULL, а если myprog --auto-update=blah, то getopt будет равен blah.
Вопрос - что я делаю не так?

