Thanks, I found example in fdtgrep.
What do you think about function like:

static void print_usage(const char *msg)
{
        if (msg != NULL)
                fprintf(stderr, "Error: %s\n", msg);
        fprintf(stderr, "Usage: %s [-a <algo>] [-k <keydir>] [-n <keyname>] [-r 
<conf|image>] <fdt blob>\n"
                "Options:\n"

                "\t-a <algo>       Cryptographic algorithm. Optional parameter, 
default: sha1,rsa2048\n"
                "\t-k <keydir>     Directory with public key. Optional 
parameter, default: .\n"
                "\t-n <keyname>    Public key name. Optional parameter, 
default: key\n"
                "\t-r <conf|image> Required: If present this indicates that the 
key must be verified for the image / configuration to be considered valid\n"
                "\t<fdt blob>      FDT blob file for adding of the public key. 
Required parameter.\n",
                cmdname);
        exit(EXIT_FAILURE);
}


Is it ok?

-----Original Message-----
From: Jan Kiszka <jan.kis...@siemens.com> 
Sent: Wednesday, November 10, 2021 10:22 PM
To: Roman Kopytin <roman.kopy...@kaspersky.com>; u-boot@lists.denx.de
Cc: Rasmus Villemoes <rasmus.villem...@prevas.dk>
Subject: Re: [PATCH 1/2] tools: add fdt_add_pubkey

On 10.11.21 09:26, Roman Kopytin wrote:
> Could you please provide good example with needed style for helper?
> In tools I saw a lot of programs w/o help.
> 

Have a look at binman to see this full-blown - not a completely fair comparison 
as it benefits from Python argparse.

Jan

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

Reply via email to