multilang-depends / depends

Depends is a fast, comprehensive code dependency analysis tool
MIT License
195 stars 54 forks source link

depends command gives reverse output for dv8 mapping flag #46

Open leilani-reich opened 1 year ago

leilani-reich commented 1 year ago

Hello,

I noticed while running the Depends command, the -m flag, which should "Output DV8 dependency map file", as stated in the README, works the opposite way. In particular, if I include this -m flag in my command, then I will only get a Depends output. However, if I don't include the -m flag, then I will get both the Depends output and a mapping file called "depends-dv8map.mapping."

I tried this command on the newest v0.9.7 version of Depends (depends-0.9.7-package-20221104.zip and depends-0.9.7-package-20221104a.zip) as well as an older version v0.9.6a.

To reproduce:

Here is the command I called with no mapping option, which gave me both the json Depends output and a mapping file:

java -jar depends.jar java path/to/directory depends-0.9.6-output-no-map

Here is the command I called with the -m flag, which gave me only the json Depends output.

java -jar depends.jar java path/to/directory depends-0.9.6-output-map -m

Note: My path/to/directory was a local path to a clone of the Apache Helix git repository.

Thank you.

gangz commented 1 year ago

This problem is due to an incorrect default setting. To minimize the impact on existing users, I believe the appropriate approach would be to set the default value to 'true'. Only when the '-m' flag is specified, the mapping file will not be outputted.

leilani-reich commented 1 year ago

Alright, thank you!