Index: mojo/examples/wget/wget.cc |
diff --git a/mojo/examples/wget/wget.cc b/mojo/examples/wget/wget.cc |
index 0f7d891f88f284cde36c195fb02bb2869d6f803c..f7c03bb6af17bdd074ffe400c68b5b371c6fced6 100644 |
--- a/mojo/examples/wget/wget.cc |
+++ b/mojo/examples/wget/wget.cc |
@@ -72,12 +72,12 @@ class WGetApp : public ApplicationDelegate { |
public: |
virtual void Initialize(ApplicationImpl* app) override { |
app->ConnectToService("mojo:mojo_network_service", &network_service_); |
- Start(); |
+ Start(app->args()); |
} |
private: |
- void Start() { |
- std::string url = PromptForURL(); |
+ void Start(const Array<String>& args) { |
+ std::string url((args.size() > 1) ? args[1].get() : PromptForURL()); |
printf("Loading: %s\n", url.c_str()); |
network_service_->CreateURLLoader(Get(&url_loader_)); |