public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
To: Stoiko Ivanov <s.ivanov@proxmox.com>
Cc: pmg-devel@lists.proxmox.com
Subject: Re: [pmg-devel] [PATCH pmg-api 3/3] pmgdb: add active parameter to dump
Date: Tue, 27 Feb 2024 14:21:33 +0100	[thread overview]
Message-ID: <aba1d59f-0d94-4975-871e-ef7bdd0e5fd5@proxmox.com> (raw)
In-Reply-To: <20240227135327.1bdac87c@rosa.proxmox.com>

Am 27/02/2024 um 13:53 schrieb Stoiko Ivanov:
> On Mon, 26 Feb 2024 20:11:28 +0100
> Thomas Lamprecht <t.lamprecht@proxmox.com> wrote:
>> 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).

I did not check, but I think we hardly have a very strong coherent behavior
here, but yeah, a tri-state behavior for a boolean flag isn't fully ideal
either.

> 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)?

That would be more explicit and avoid all misinterpretation potential, i.e.,
more than fine with me.




  reply	other threads:[~2024-02-27 13:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 21:06 [pmg-devel] [PATCH pmg-api 0/3] small improvments to pmgdb dump output Stoiko Ivanov
2024-02-22 21:06 ` [pmg-devel] [PATCH pmg-api 1/3] pmgdb: highlight active rules Stoiko Ivanov
2024-02-22 21:06 ` [pmg-devel] [PATCH pmg-api 2/3] pmgdb: drop "found" prefixes for each rule and group Stoiko Ivanov
2024-02-22 21:06 ` [pmg-devel] [PATCH pmg-api 3/3] pmgdb: add active parameter to dump Stoiko Ivanov
2024-02-26 19:11   ` Thomas Lamprecht
2024-02-27 12:53     ` Stoiko Ivanov
2024-02-27 13:21       ` Thomas Lamprecht [this message]
2024-02-23 10:40 ` [pmg-devel] [PATCH pmg-api 0/3] small improvments to pmgdb dump output Friedrich Weber
2024-02-23 11:19   ` Stoiko Ivanov
2024-02-23 12:53 ` Alexander Zeidler
2024-02-23 16:46 ` [pmg-devel] applied-series: " Thomas Lamprecht

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aba1d59f-0d94-4975-871e-ef7bdd0e5fd5@proxmox.com \
    --to=t.lamprecht@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    --cc=s.ivanov@proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal