zdump/opts: Make parsing of command line arguments testable

Make the C module responsible for the parsing of command-line arguments
independent of other global variables. This improves its testability.

Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Alexander Egorenkov
2021-10-11 16:09:07 +02:00
committed by Jan Höppner
parent 1005e7be7e
commit df338a3bac
4 changed files with 155 additions and 142 deletions
+1 -1
View File
@@ -177,7 +177,7 @@ static int do_stdout(void)
int main(int argc, char *argv[])
{
sig_handler_init();
opts_parse(argc, argv);
opts_parse(argc, argv, &g.opts);
switch (g.opts.action) {
case ZG_ACTION_STDOUT: