Skip to content

Commit 07ce848

Browse files
bkonyicommit-bot@chromium.org
authored andcommitted
[ Dart CLI ] Fix issue where -D was not being accepted by 'dart run'
Fixes #43779 Fixed: 43779 Change-Id: I886db8014cc3ea1f870974a21a552d7983b6b408 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/167700 Reviewed-by: Ryan Macnak <[email protected]> Commit-Queue: Ben Konyi <[email protected]>
1 parent 0e88702 commit 07ce848

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

pkg/dartdev/lib/src/commands/run.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ class RunCommand extends DartdevCommand<int> {
104104
);
105105
}
106106
argParser
107+
..addMultiOption('define',
108+
abbr: 'D', help: 'Defines an environment variable', hide: true)
107109
..addFlag(
108110
'disable-service-auth-codes',
109111
hide: !verbose,

pkg/dartdev/test/commands/run_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ void run() {
154154
'--no-pause-isolates-on-start',
155155
'--no-pause-isolates-on-exit',
156156
'--no-pause-isolates-on-unhandled-exceptions',
157+
'-Dfoo=bar',
157158
p.relativeFilePath,
158159
]);
159160
expect(
@@ -173,6 +174,7 @@ void run() {
173174
'--no-pause-isolates-on-exit',
174175
'--no-pause-isolates-on-unhandled-exceptions',
175176
'--disable-service-auth-codes',
177+
'-Dfoo=bar',
176178
p.relativeFilePath,
177179
]);
178180

0 commit comments

Comments
 (0)