Re: [ PATCH v4 1/6] sign-file: refactor argument parsing logic

From: David Howells
Date: Tue Mar 14 2023 - 12:03:25 EST


Can you please include a cover note indicating what this series is about?

> - Use getopt_long_only for parsing input args
> - Use more easy to remember command line argument names

You're also adding a bunch of new flags. I would recommend splitting that
into a separate patch.

> + char *hash_algo = opts.hash_algo;
> + char *dest_name = opts.dest_name;
> + char *private_key_name = opts.private_key_name;
> + char *raw_sig_name = opts.raw_sig_name;
> + char *x509_name = opts.x509_name;
> + char *module_name = opts.module_name;

I wonder if these should now be const char *.

> @@ -292,7 +381,6 @@ int main(int argc, char **argv)
> exit(3);
> }
> #endif
> -
> /* Open the module file */
> bm = BIO_new_file(module_name, "rb");
> ERR(!bm, "%s", module_name);

Please don't remove that blank line - it separates two logically distinct
parts of the program.

David