diff --git a/cmdline.h b/cmdline.h index cee453b..389d166 100644 --- a/cmdline.h +++ b/cmdline.h @@ -287,13 +287,13 @@ public: continue; } - if (i+1>=argc || strncmp(argv[i+1], "-", 1)==0 || - !options[lookup[last]]->has_value()){ - set_option(lookup[last]); - continue; + if (i+1has_value()){ + set_option(lookup[last], argv[i+1]); + i++; + } + else{ + set_option(lookup[last]); } - set_option(lookup[last], argv[i+1]); - i++; } else{ others.push_back(argv[i]); diff --git a/test.cpp b/test.cpp index 444e68d..d3650e9 100644 --- a/test.cpp +++ b/test.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) a.footer("ファイル名 ..."); if (argc==1){ - cerr<