XcodeCoverageConverter icon indicating copy to clipboard operation
XcodeCoverageConverter copied to clipboard

How to pass Exclude packages Array

Open jvigneshcs opened this issue 4 years ago • 2 comments

I am able to use this xcc command as per the instructions provided in the README file. However I am trying to provide array of packages for --exclude-packages parameter as follows,

xcc generate coverage.json TargetDirectory cobertura-xml --exclude-packages Tests AnotherPackageName --verbose

I get the following error,

Error: The value 'AnotherPackageName' is invalid for '<output-formats>'
Usage: xcc generate <json-file> <output-path> [<output-formats> ...] [--exclude-targets <exclude-targets> ...] [--exclude-packages <exclude-packages> ...] [--verbose]

The items (excluding first item) which I pass for --exclude-packages is considered for output-formats. How to fix this?

jvigneshcs avatar Sep 07 '21 08:09 jvigneshcs

Hi @jvigneshcs

sorry for the laaaaate answer. It is not supported for now. You will have to pass multiple --exclude-packages XXX instructions.

Perhaps we could do better with variadic arguments but I don't know if Swift Argument Parser allows that. If you have time you can take a look and make a PR, could be cool.

Thanks.

twittemb avatar Mar 22 '22 09:03 twittemb

I think it does now @twittemb. Looks like it would be a pretty easy fix @jvigneshcs 

https://github.com/apple/swift-argument-parser/blob/82905286cc3f0fa8adc4674bf49437cab65a8373/Sources/ArgumentParser/Parsable%20Properties/Option.swift#L254

mgray88 avatar Mar 22 '22 13:03 mgray88