Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Support vararg files to instrument #193

Open
jsdevel opened this issue Apr 23, 2014 · 5 comments
Open

Support vararg files to instrument #193

jsdevel opened this issue Apr 23, 2014 · 5 comments

Comments

@jsdevel
Copy link

jsdevel commented Apr 23, 2014

It would be really nice if istanbul instrument accepted a vararg number of files / directories to instrument as the last argument[s].

@gotwarlost
Copy link
Owner

How would you specify where the output files are created in this case?

@jsdevel
Copy link
Author

jsdevel commented Apr 24, 2014

@gotwarlost the --output option allows for a file or directory, so I naturally assumed this would work: istanbul instrument --output lib-cov lib server.js.

@gotwarlost
Copy link
Owner

So in your example, lib-cov will have a server.js in it and a subdirectory called lib? In the one-arg case it is always clear what the root output directory is. Not so in the multi-arg case - it would have to be the common ancestor of all files/ dirs passed in.

@jsdevel
Copy link
Author

jsdevel commented Jul 9, 2014

I can see your point.

A lot of projects have a root file like server.js or app.js. They also have lib. Would there be a better way other than var args?

@gotwarlost
Copy link
Owner

I do agree with you that having the app.js or server.js outside the only directory you want to instrument requires you to jump thru hoops by passing the top-level dir and a bunch of excludes.

I do like the interface you have proposed - I think calling the output dir lib-cov is confusing. Instead if you said istanbul instrument --output instrumented-app server.js lib the command makes perfect sense.

I need to see if there are any other implications of supporting multiple dirs/ files.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants