--diff flag is useless without -v option
Describe the bug
Hello !
The commands
permifrost run <spec-file> --dry --diff
and
permifrost run <spec-file> --dry
Gives the same result in every situation, it seems that --diff is just adding a + sign before the printing of query.
Steps To Reproduce
Create a spec-file with not granted on server rights, run permifrost run <spec-file> --dry --diff here this is the same result as permifrost run <spec-file> --dry because all rights are new (not on the server).
Manually run one of the granting on the server, so if I understood corrcetly the --diff flag should show the same lines but without the + before the query used to grant the new manually granted right.
if you run permifrost run <spec-file> --dry --diff you will not see the manually added right but only new rights with a + and a PENDING state
Expected behavior
permifrost run <spec-file> --dry --diff should show already granted rights on the server. (as permifrost -v run <spec-file> --dry --diff is doing)
Screenshots and log output
If applicable, add screenshots or log output to help explain your problem.
The output of permifrost --version:
permifrost, version 0.14.0
Macos Python 3.9.1
Additional context
I think it is due to this line https://gitlab.com/gitlab-data/permifrost/-/blob/master/src/permifrost/cli/permissions.py#L191
In my understanding we are showing only NOT already granted queries unless the -v option is set.
I think --diff should imply -v to show the skipped queries however it is a little misleading I might have done something wrong but this is the --diff behaviour I understood from the readme.
I think this below would be good, or if no dev is wanted at least upd the readme.
This :
if ctx.parent.params.get("verbose", 0) >= 1:
print_skipped = True
Could be replaced by
if ctx.parent.params.get("verbose", 0) >= 1 or diff is True:
print_skipped = True
Thanks a lot for the library