| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Functions that configure the shell before it is run manipulating its argument | 5 """Functions that configure the shell before it is run manipulating its argument |
| 6 list. | 6 list. |
| 7 """ | 7 """ |
| 8 | 8 |
| 9 import os.path | 9 import os.path |
| 10 import sys | 10 import sys |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 arguments.append(key + value) | 179 arguments.append(key + value) |
| 180 | 180 |
| 181 return arguments | 181 return arguments |
| 182 | 182 |
| 183 | 183 |
| 184 def AddShellArguments(parser): | 184 def AddShellArguments(parser): |
| 185 """Adds argparse arguments allowing to configure shell abstraction using | 185 """Adds argparse arguments allowing to configure shell abstraction using |
| 186 ConfigureShell() below. | 186 ConfigureShell() below. |
| 187 """ | 187 """ |
| 188 # Arguments indicating paths to binaries and tools. | 188 # Arguments indicating paths to binaries and tools. |
| 189 parser.add_argument('--adb-path', default='adb', | 189 parser.add_argument('--adb-path', help='Path of the adb binary.') |
| 190 help='Path of the adb binary.') | |
| 191 parser.add_argument('--shell-path', help='Path of the Mojo shell binary.') | 190 parser.add_argument('--shell-path', help='Path of the Mojo shell binary.') |
| 192 parser.add_argument('--origin-path', help='Path of a directory to be set as ' | 191 parser.add_argument('--origin-path', help='Path of a directory to be set as ' |
| 193 'the origin for mojo: urls') | 192 'the origin for mojo: urls') |
| 194 | 193 |
| 195 # Arguments configuring the shell run. | 194 # Arguments configuring the shell run. |
| 196 parser.add_argument('--android', help='Run on Android', | 195 parser.add_argument('--android', help='Run on Android', |
| 197 action='store_true') | 196 action='store_true') |
| 198 parser.add_argument('--origin', help='Origin for mojo: URLs.') | 197 parser.add_argument('--origin', help='Origin for mojo: URLs.') |
| 199 parser.add_argument('--map-url', action='append', | 198 parser.add_argument('--map-url', action='append', |
| 200 help='Define a mapping for a url in the format ' | 199 help='Define a mapping for a url in the format ' |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 if config_args.use_osmesa: | 264 if config_args.use_osmesa: |
| 266 shell_args.append('--args-for=mojo:native_viewport_service --use-osmesa') | 265 shell_args.append('--args-for=mojo:native_viewport_service --use-osmesa') |
| 267 | 266 |
| 268 if config_args.origin: | 267 if config_args.origin: |
| 269 shell_args.append('--origin=' + config_args.origin) | 268 shell_args.append('--origin=' + config_args.origin) |
| 270 elif config_args.origin_path: | 269 elif config_args.origin_path: |
| 271 shell_args.extend(ConfigureLocalOrigin(shell, config_args.origin_path, | 270 shell_args.extend(ConfigureLocalOrigin(shell, config_args.origin_path, |
| 272 fixed_port=True)) | 271 fixed_port=True)) |
| 273 | 272 |
| 274 return shell, shell_args | 273 return shell, shell_args |
| OLD | NEW |