mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Update getopts
*Sigh* https://github.com/rust-lang-nursery/getopts/pull/53#issuecomment-415770100
This commit is contained in:
parent
76dd6a4cdb
commit
a9627d233f
6 changed files with 13 additions and 8 deletions
|
@ -176,12 +176,17 @@ def extract_arg(name, args):
|
|||
|
||||
|
||||
def extract_args(name, args):
|
||||
assert "=" not in name
|
||||
previous_arg_matches = False
|
||||
for i, arg in enumerate(args):
|
||||
if previous_arg_matches:
|
||||
yield i, arg
|
||||
previous_arg_matches = arg == name
|
||||
|
||||
arg, sep, value = arg.partition("=")
|
||||
if arg == name and sep == "=":
|
||||
yield i, value
|
||||
|
||||
|
||||
def wait_for_tcp_server(adb, port):
|
||||
while call(adb + ["shell", "nc -z 127.0.0.1 %s" % port], stdout=sys.stderr) != 0:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue