On 03.11.21 15:57, Michael Adler wrote:
> bg_setenv and bg_printenv have different command-line interfaces. Thus
> it is natural to have separate parsers and more importantly, store the
> arguments of each cli into its own struct, thereby avoiding potential
> confusion when processing the arguments later on.
> 
> * `struct arguments` is split into `arguments_setenv` and
>   `arguments_printenv`
> * `parse_opt` is split into `parse_common_opt`, `parse_setenv_opt` and
>   `parse_printenv_opt`
> 
> Signed-off-by: Michael Adler <[email protected]>
> ---
>  tools/bg_setenv.c | 258 +++++++++++++++++++++++++++++-----------------
>  1 file changed, 161 insertions(+), 97 deletions(-)
> 
> diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c
> index 3e76156..de1a622 100644
> --- a/tools/bg_setenv.c
> +++ b/tools/bg_setenv.c
> @@ -24,7 +24,17 @@
>  static char doc[] =
>       "bg_setenv/bg_printenv - Environment tool for the EFI Boot Guard";
>  
> +// clang-format off
> +#define BG_CLI_OPTIONS_COMMON                                                
>   \
> +     {"filepath", 'f', "ENVFILE", 0,                                        \
> +      "Environment to use. Expects a file name, "                           \
> +      "usually called BGENV.DAT."},                                         \
> +     {"verbose", 'v', 0, 0, "Be verbose"},                                  \
> +     {"version", 'V', 0, 0, "Print version"}
> +// clang-format on

Can't that be solved differently, e.g. by excluding macros from clang
checks upfront? Automatic format checking is nice, but if it starts to
require cluttering the code with exception tags...

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

-- 
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/edc2d670-8a69-1faa-3ec2-8069691c7c2d%40siemens.com.

Reply via email to