9c78c8f14b
The dart run argument parser was incorrectly parsing any argument following an option that the VM treats as having a default (e.g., --observe and --enable-vm-service), resulting in a "File not found ''" error and the VM failing to start the user program. The following invocations would fail due to 'foo.dart' being treated as the value for the option to the left: - dart run --observe foo.dart - dart run --enable-vm-service foo.dart This change strips these two options from the arguments sent to dartdev as both are handled directly in the VM and are only included in the dart run argument parser for the help message. Fixes https://github.com/dart-lang/sdk/issues/55185 TEST=regression test added to run_test.dart. Fixed: 55185 Change-Id: I1c89fec3ee46296ee4ebb847eb47a7845dfdb399 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/357360 Reviewed-by: Derek Xu <derekx@google.com> Commit-Queue: Ben Konyi <bkonyi@google.com>