Index: sky/shell/linux/main.cc |
diff --git a/sky/shell/linux/main.cc b/sky/shell/linux/main.cc |
index 0ed81d3fc4fe8f2d554947733e740b065508209f..06759977a7325284f636ba28099011bf10ce5e16 100644 |
--- a/sky/shell/linux/main.cc |
+++ b/sky/shell/linux/main.cc |
@@ -27,6 +27,7 @@ void Usage() { |
std::cerr << "Usage: sky_shell" |
<< " --" << switches::kNonInteractive |
<< " --" << switches::kPackageRoot << "=PACKAGE_ROOT" |
+ << " --" << switches::kSnapshot << "=SNAPSHOT" |
<< " [ MAIN_DART ]" << std::endl; |
} |
@@ -42,19 +43,27 @@ void Init() { |
std::string package_root = |
command_line.GetSwitchValueASCII(switches::kPackageRoot); |
+ runner.set_package_root(package_root); |
- std::string main; |
- auto args = command_line.GetArgs(); |
- if (!args.empty()) |
- main = args[0]; |
+ scoped_ptr<TestRunner::SingleTest> single_test; |
+ if (command_line.HasSwitch(switches::kSnapshot)) { |
+ single_test.reset(new TestRunner::SingleTest); |
+ single_test->path = command_line.GetSwitchValueASCII(switches::kSnapshot); |
+ single_test->is_snapshot = true; |
+ } else { |
+ auto args = command_line.GetArgs(); |
+ if (!args.empty()) { |
+ single_test.reset(new TestRunner::SingleTest); |
+ single_test->path = args[0]; |
+ } |
+ } |
- runner.set_package_root(package_root); |
- runner.Start(main); |
+ runner.Start(single_test.Pass()); |
} |
} // namespace |
-} // namespace shell |
-} // namespace sky |
+} // namespace shell |
+} // namespace sky |
int main(int argc, const char* argv[]) { |
base::AtExitManager exit_manager; |
@@ -63,7 +72,8 @@ int main(int argc, const char* argv[]) { |
base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); |
if (command_line.HasSwitch(sky::shell::switches::kHelp) || |
- !command_line.HasSwitch(sky::shell::switches::kPackageRoot)) { |
+ (!command_line.HasSwitch(sky::shell::switches::kPackageRoot) && |
+ !command_line.HasSwitch(sky::shell::switches::kSnapshot))) { |
sky::shell::Usage(); |
return 0; |
} |