Skip to content
Snippets Groups Projects
Commit e59732ff authored by Simon McVittie's avatar Simon McVittie
Browse files

ade: Provide conventional handling for the -- pseudo-option


The common convention of passing "--" as a separator between
arguments for this command and arguments for the wrapped command
did not work, because it would also pass the "--" through. For
instance, "ade configure --native -- --device=foo" should pass
"--device=foo" to the configure script instead of interpreting it
as ade's own --device option.

Signed-off-by: default avatarSimon McVittie <smcv@collabora.com>
Reviewed-by: default avatarAndré Magalhães <andre.magalhaes@collabora.co.uk>
Differential Revision: https://phabricator.apertis.org/D6796
parent e5aaad15
No related branches found
No related tags found
No related merge requests found
......@@ -1647,6 +1647,13 @@ if __name__ == '__main__':
obj = Ade()
args, extra = root_parser.parse_known_args(namespace=obj)
if hasattr(obj, 'args'):
if obj.args and obj.args[0] == '--':
# REMAINING arguments include the "--" if the user supplied one.
# Remove it. If there is more than one instance "--", this still
# does the right thing, by passing n-1 instances to the next
# layer of wrapped tools.
obj.args = obj.args[1:]
obj.args += extra
elif extra:
# Re-parse the command line without unknown arguments allowed,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment