| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkCommandLineFlags.h" | 8 #include "SkCommandLineFlags.h" |
| 9 #include "SkTDArray.h" | 9 #include "SkTDArray.h" |
| 10 | 10 |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 flag->setDouble(atof(argv[i])); | 280 flag->setDouble(atof(argv[i])); |
| 281 break; | 281 break; |
| 282 default: | 282 default: |
| 283 SkDEBUGFAIL("Invalid flag type"); | 283 SkDEBUGFAIL("Invalid flag type"); |
| 284 } | 284 } |
| 285 break; | 285 break; |
| 286 } | 286 } |
| 287 flag = flag->next(); | 287 flag = flag->next(); |
| 288 } | 288 } |
| 289 if (!flagMatched) { | 289 if (!flagMatched) { |
| 290 SkString stripped(argv[i]); | |
| 291 while (stripped.startsWith('-')) { | |
| 292 stripped.remove(0, 1); | |
| 293 } | |
| 294 if (!FLAGS_undefok) { | 290 if (!FLAGS_undefok) { |
| 295 SkDebugf("Got unknown flag \"%s\". Exiting.\n", argv[i]); | 291 SkDebugf("Got unknown flag \"%s\". Exiting.\n", argv[i]); |
| 296 exit(-1); | 292 exit(-1); |
| 297 } | 293 } |
| 298 } | 294 } |
| 299 } | 295 } |
| 300 } | 296 } |
| 301 // Since all of the flags have been set, release the memory used by each | 297 // Since all of the flags have been set, release the memory used by each |
| 302 // flag. FLAGS_x can still be used after this. | 298 // flag. FLAGS_x can still be used after this. |
| 303 SkFlagInfo* flag = gHead; | 299 SkFlagInfo* flag = gHead; |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 } | 343 } |
| 348 | 344 |
| 349 } // namespace | 345 } // namespace |
| 350 | 346 |
| 351 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { | 347 bool SkCommandLineFlags::ShouldSkip(const SkTDArray<const char*>& strings, const
char* name) { |
| 352 return ShouldSkipImpl(strings, name); | 348 return ShouldSkipImpl(strings, name); |
| 353 } | 349 } |
| 354 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { | 350 bool SkCommandLineFlags::ShouldSkip(const StringArray& strings, const char* name
) { |
| 355 return ShouldSkipImpl(strings, name); | 351 return ShouldSkipImpl(strings, name); |
| 356 } | 352 } |
| OLD | NEW |