Benjamin Lerman | 4fc210c | 2014-12-18 18:18:06 +0100 | [diff] [blame] | 1 | // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef SHELL_COMMAND_LINE_UTIL_H_ |
| 6 | #define SHELL_COMMAND_LINE_UTIL_H_ |
| 7 | |
| 8 | #include "shell/context.h" |
| 9 | |
Benjamin Lerman | 4fc210c | 2014-12-18 18:18:06 +0100 | [diff] [blame] | 10 | namespace shell { |
| 11 | |
| 12 | // Parse the given arg, looking for an --args-for switch. If this is not the |
| 13 | // case, returns |false|. Otherwise, returns |true| and set |*value| to the |
| 14 | // value of the switch. |
| 15 | bool ParseArgsFor(const std::string& arg, std::string* value); |
| 16 | |
| 17 | // The value of app_url_and_args is "<mojo_app_url> [<args>...]", where args |
| 18 | // is a list of "configuration" arguments separated by spaces. If one or more |
| 19 | // arguments are specified they will be available when the Mojo application |
| 20 | // is initialized. This returns the mojo_app_url, and set args to the list of |
| 21 | // arguments. |
Nick Bray | 8636343 | 2015-01-27 12:55:35 -0800 | [diff] [blame] | 22 | GURL GetAppURLAndArgs(Context* context, |
| 23 | const std::string& app_url_and_args, |
Benjamin Lerman | 4fc210c | 2014-12-18 18:18:06 +0100 | [diff] [blame] | 24 | std::vector<std::string>* args); |
| 25 | |
| 26 | // Apply arguments for an application from a line with the following format: |
| 27 | // '--args-for=application_url arg1 arg2 arg3' |
| 28 | // This does nothing if the line has not the right format. |
| 29 | void ApplyApplicationArgs(Context* context, const std::string& args); |
| 30 | |
| 31 | // Run all application defined on the command line, using the given context. |
| 32 | void RunCommandLineApps(Context* context); |
| 33 | |
| 34 | } // namespace shell |
Benjamin Lerman | 4fc210c | 2014-12-18 18:18:06 +0100 | [diff] [blame] | 35 | |
| 36 | #endif // SHELL_COMMAND_LINE_UTIL_H_ |