Commit abf1b188 authored by Masaki Muranaka's avatar Masaki Muranaka

Remove strncmp(). It enables to process various options.

parent 2e937a5b
...@@ -71,9 +71,11 @@ main(int argc, char **argv) ...@@ -71,9 +71,11 @@ main(int argc, char **argv)
return EXIT_FAILURE; return EXIT_FAILURE;
} }
if (argc == 2 && strncmp(argv[1], "-v", 2) == 0) { if (argc == 2 && argv[1][0] == '-') {
printf("verbose mode: enable\n\n"); if (argv[1][1] == 'v') {
mrb_gv_set(mrb, mrb_intern(mrb, "$mrbtest_verbose"), mrb_true_value()); printf("verbose mode: enable\n\n");
mrb_gv_set(mrb, mrb_intern(mrb, "$mrbtest_verbose"), mrb_true_value());
}
} }
mrb_init_mrbtest(mrb); mrb_init_mrbtest(mrb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment