jfeliu007 / goplantuml

PlantUML Class Diagram Generator for golang projects
MIT License
1.84k stars 172 forks source link

Enhancement: Clarify/Improve the `-ignore` usage #162

Open j1elo opened 12 months ago

j1elo commented 12 months ago

This is a small enhancement suggestion to the help text of -ignore, both in code and the README file. Currently it says:

  -ignore string
        comma separated list of folders to ignore

Given usage of -recursive, it felt natural that it would suffice with giving a list of directory leafs, i.e. the name of directories to ignore.

For example: goplantuml -recursive -ignore 'package1,package2,package3' .

Due to the recursive mode, and the option description, this feels like what -ignore wants. However in reality the option checks if the directories exist from where the command is being run! So it requires a complete relative path to the desired directory to ignore. So the command should be:

goplantuml -recursive -ignore 'pkg/package1,pkg/package2,pkg/some/nested/dir/package3' .

My small suggestion is to clarify this in the help text:

  -ignore string
        comma-separated list of paths to ignore, either absolute or relative to the current working directory (CWD)

An even better thing would be to search for ignore dirs starting from the list of directories given as arguments (i.e. for each ignore dir, see if it exists inside any of the input dirs), that way the ignore list doesn't need to change depending on where goplantuml is being run from.