OSDN Git Service

[libcxx][lit] Simplify parsing of trailing executor arguments
authorAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 21 Jul 2020 07:35:47 +0000 (08:35 +0100)
committerAlex Richardson <Alexander.Richardson@cl.cam.ac.uk>
Tue, 21 Jul 2020 08:03:45 +0000 (09:03 +0100)
commit3980e8956b68f229a79194fbd46e4a91abf3aa2e
tree3a2b107672f73ba3e8774fb7e9bd2f1c5feec1df
parentaa84e6e579bedffda43f8ebffa553cf277947e96
[libcxx][lit] Simplify parsing of trailing executor arguments

Adding a positional argparse.ONE_OR_MORE arguments will correctly remove
the "--" separator after --env and parse only the command. This also has
the advantage that misspelled flags raise an argparse error rather than
silently being added to the command to be executed.

I discovered this while adding a new commandline option to ssh.py to allow
passing additional arguments to the scp/ssh commands since this is required
for our CHERI CI where we need to pass `-F <custom_config_file>` to each
ssh/scp command to set various arguments such as the localhost port, usage
of controlmaster, etc. to speed up connections to our emulated QEMU systems.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D84096
libcxx/utils/run.py
libcxx/utils/ssh.py