OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/flags.h" | 5 #include "src/flags.h" |
6 | 6 |
7 #include <cctype> | 7 #include <cctype> |
8 #include <cstdlib> | 8 #include <cstdlib> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 } | 422 } |
423 | 423 |
424 // handle errors | 424 // handle errors |
425 bool is_bool_type = flag->type() == Flag::TYPE_BOOL || | 425 bool is_bool_type = flag->type() == Flag::TYPE_BOOL || |
426 flag->type() == Flag::TYPE_MAYBE_BOOL; | 426 flag->type() == Flag::TYPE_MAYBE_BOOL; |
427 if ((is_bool_type && value != NULL) || (!is_bool_type && is_bool) || | 427 if ((is_bool_type && value != NULL) || (!is_bool_type && is_bool) || |
428 *endp != '\0') { | 428 *endp != '\0') { |
429 PrintF(stderr, "Error: illegal value for flag %s of type %s\n" | 429 PrintF(stderr, "Error: illegal value for flag %s of type %s\n" |
430 "Try --help for options\n", | 430 "Try --help for options\n", |
431 arg, Type2String(flag->type())); | 431 arg, Type2String(flag->type())); |
| 432 if (is_bool_type) { |
| 433 PrintF(stderr, |
| 434 "To set or unset a boolean flag, use --flag or --no-flag.\n"); |
| 435 } |
432 return_code = j; | 436 return_code = j; |
433 break; | 437 break; |
434 } | 438 } |
435 | 439 |
436 // remove the flag & value from the command | 440 // remove the flag & value from the command |
437 if (remove_flags) { | 441 if (remove_flags) { |
438 while (j < i) { | 442 while (j < i) { |
439 argv[j++] = NULL; | 443 argv[j++] = NULL; |
440 } | 444 } |
441 } | 445 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 #define FLAG_MODE_DEFINE_IMPLICATIONS | 576 #define FLAG_MODE_DEFINE_IMPLICATIONS |
573 #include "src/flag-definitions.h" // NOLINT(build/include) | 577 #include "src/flag-definitions.h" // NOLINT(build/include) |
574 #undef FLAG_MODE_DEFINE_IMPLICATIONS | 578 #undef FLAG_MODE_DEFINE_IMPLICATIONS |
575 ComputeFlagListHash(); | 579 ComputeFlagListHash(); |
576 } | 580 } |
577 | 581 |
578 | 582 |
579 uint32_t FlagList::Hash() { return flag_hash; } | 583 uint32_t FlagList::Hash() { return flag_hash; } |
580 } // namespace internal | 584 } // namespace internal |
581 } // namespace v8 | 585 } // namespace v8 |
OLD | NEW |