[pmg-devel] [PATCH pmg-api 3/3] pmgdb: add active parameter to dump

Stoiko Ivanov s.ivanov at proxmox.com
Tue Feb 27 13:53:27 CET 2024


Thanks for the suggestion - comment in-line:

On Mon, 26 Feb 2024 20:11:28 +0100
Thomas Lamprecht <t.lamprecht at proxmox.com> wrote:

>..snip..
> 
> If I call this with active set to disabled, i.e. as `pmgdb dump --active 0`, then
> I still get the active rules, which feels rather a bit wrong.
> 
> IMO this could be interpreted as ternary:
> 
> 1. undef (not passed) -> both
> 2. true (--active[=1]) -> active only
> 3. false (--active=0) -> incative only

this does break how booleans behave across most of our CLI tools (afaict).
can be fine, especially with this particular call, which is mostly for
debugging.
Alternatively - why not make this a regular enum (--rules
<all|active|inactive>, defaulting to all)?







More information about the pmg-devel mailing list