> But this will now dump irrespective of "verbosity", no? No, the if-block is only entered for bg_printenv, and (unfortunately) bg_printenv always implies verbosity [1].
> You rather need to pull this up an share it with the !write_mode case. That would reduce code duplication, yes, but I think it's the wrong call, since verbosity is conceptually wrong here: if I run bg_printenv, I *always* want to dump the BGENVs - I mean, that's why I ran bg_printenv in the first place. In fact, in the case of bg_printenv, verbosity should rather turn on additional output. As it is now, the variable verbosity is wasted for bg_printetnv, because it's always true [1]. Some background: I'm close to finishing the bg_printenv enhancement which we discussed here last week and it will further decouple setenv/printenv (for it is necessary to split the argument parser). The whole entanglement makes it difficult to extend one without the other, and this patch addresses one instance of it. [1] https://github.com/siemens/efibootguard/blob/c01324d0da202727eb0744c0f67a78f9c9b65c46/tools/bg_setenv.c#L670 -- Michael Adler Siemens AG T RDA IOT SES-DE Otto-Hahn-Ring 6 81739 München, Deutschland Siemens Aktiengesellschaft: Vorsitzender des Aufsichtsrats: Jim Hagemann Snabe; Vorstand: Roland Busch, Vorsitzender; Klaus Helmrich, Cedrik Neike, Matthias Rebellius, Ralf P. Thomas, Judith Wiese; Sitz der Gesellschaft: Berlin und München, Deutschland; Registergericht: Berlin-Charlottenburg, HRB 12300, München, HRB 6684; WEEE-Reg.-Nr. DE 23691322 -- You received this message because you are subscribed to the Google Groups "EFI Boot Guard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/efibootguard-dev/20211019085752.mldeyv7hfzcreqae%40kratos.
