Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: lib/src/compiler/command.dart

Issue 2113203002: Print usage when no source files are passed (Closed) Base URL: https://github.com/dart-lang/dev_compiler@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/compiler/command.dart
diff --git a/lib/src/compiler/command.dart b/lib/src/compiler/command.dart
index 8a033a5251dc840e911932cc1e38b44baf69ab63..d9c96a329eaf65774efbfb5bec844068054eee97 100644
--- a/lib/src/compiler/command.dart
+++ b/lib/src/compiler/command.dart
@@ -67,6 +67,10 @@ class CompileCommand extends Command {
modulePath = path.basenameWithoutExtension(outPath);
}
+ if (argResults.rest.isEmpty) {
+ usageException('Please pass at least one source file as an argument.');
+ }
+
var unit = new BuildUnit(modulePath, buildRoot, argResults.rest,
(source) => _moduleForLibrary(moduleRoot, source));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698