#include #include #include #include extern char *optarg; char *f_host; int parse(int argc, char **argv) { char opt; bool h; while ((opt = getopt(argc, argv, "h:")) != EOF) { switch (opt) { case 'h': f_host = optarg; h = true; break; } } if (!h) { printf("Please provide all arguments.\n"); exit(1); } return optind; }