142 |
/* Copy the struct information in the longoptions. */ |
/* Copy the struct information in the longoptions. */ |
143 |
longopts[j].name = option_table[i].name; |
longopts[j].name = option_table[i].name; |
144 |
longopts[j].has_arg = option_table[i].has_arg; |
longopts[j].has_arg = option_table[i].has_arg; |
145 |
longopts[j].flag = option_table[i].set_flag; |
/* When an options is declared having 'optional_argument' and |
146 |
|
a flag is specified to be set, the option is skipped on |
147 |
|
command line. So we never use a flag when a command line |
148 |
|
option is declared 'optional_argument. */ |
149 |
|
if (longopts[j].has_arg == optional_argument) |
150 |
|
longopts[j].flag = NULL; |
151 |
|
else |
152 |
|
longopts[j].flag = option_table[i].set_flag; |
153 |
longopts[j++].val = option_table[i].val; |
longopts[j++].val = option_table[i].val; |
154 |
} |
} |
155 |
longopts[number_options].name = NULL; |
longopts[number_options].name = NULL; |