feature: parsing with getopt pretty much done (some checks tbd)
This commit is contained in:
20
include/parsing.h
Normal file
20
include/parsing.h
Normal file
@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
|
||||
#define NB_OPTIONS 5
|
||||
|
||||
typedef enum {
|
||||
FL_HELP,
|
||||
FL_PORTS,
|
||||
FL_IP,
|
||||
FL_SPEEDUP,
|
||||
FL_SCAN,
|
||||
} e_flag;
|
||||
|
||||
struct option_lst {
|
||||
e_flag flag;
|
||||
char *arg;
|
||||
struct option_lst *next;
|
||||
};
|
||||
|
||||
struct option_lst *parse_options(int ac, char *const *av);
|
||||
char *get_option_arg(struct option_lst *options, e_flag flag);
|
Reference in New Issue
Block a user