mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
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:
committed by
Jan Höppner
parent
1005e7be7e
commit
df338a3bac
+2
-29
@@ -12,43 +12,16 @@
|
||||
#ifndef ZGETDUMP_H
|
||||
#define ZGETDUMP_H
|
||||
|
||||
#include "zg.h"
|
||||
|
||||
/*
|
||||
* zgetdump options
|
||||
*/
|
||||
struct options {
|
||||
int action_specified;
|
||||
enum zg_action action;
|
||||
char *device;
|
||||
char *mount_point;
|
||||
int fmt_specified;
|
||||
const char *fmt;
|
||||
int debug_specified;
|
||||
char **argv_fuse;
|
||||
int argc_fuse;
|
||||
const char *select;
|
||||
int select_specified;
|
||||
int verbose;
|
||||
};
|
||||
|
||||
extern const char *OPTS_SELECT_KDUMP;
|
||||
extern const char *OPTS_SELECT_PROD;
|
||||
extern const char *OPTS_SELECT_ALL;
|
||||
#include "opts.h"
|
||||
|
||||
/*
|
||||
* zgetdump globals
|
||||
*/
|
||||
extern struct zgetdump_globals {
|
||||
struct zg_fh *fh;
|
||||
const char *prog_name;
|
||||
struct options opts;
|
||||
} g;
|
||||
|
||||
/*
|
||||
* Misc fuctions
|
||||
*/
|
||||
extern void opts_parse(int argc, char *argv[]);
|
||||
extern int stdout_write_dump(void);
|
||||
int stdout_write_dump(void);
|
||||
|
||||
#endif /* ZGETDUMP_H */
|
||||
|
||||
Reference in New Issue
Block a user