/* This file is part of Eclat. Copyright (C) 2012-2018 Sergey Poznyakoff. Eclat is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. Eclat is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Eclat. If not, see . */ #ifdef HAVE_GETOPT_H # include #endif OPTIONS_BEGIN("ispeek", [], [], [], [], []) OPTION(base,b,URL, []) BEGIN base_url = optarg; END OPTION(port,p,NUMBER, []) BEGIN char *p; errno = 0; port = strtol(optarg, &p, 10); if (port <= 0 || port > USHRT_MAX || errno || *p) die(EX_USAGE, "invalid port number"); END OPTION(recursive,r,, []) BEGIN recursive = 1; END OPTION(names,N,, []) BEGIN print_options |= PRINT_NAME; END OPTION(quote,Q,, []) BEGIN print_options |= PRINT_QUOTE; END OPTION(type,T,, []) BEGIN print_options |= PRINT_TYPE; END OPTION(delimiter,D,STRING, []) BEGIN delim = optarg; END OPTION(debug,d,, []) BEGIN debug_category[0].level++; END OPTIONS_END static void parse_options(int *pargc, char **pargv[]) { int argc = *pargc; char **argv = *pargv; int index; GETOPT(argc, argv, index) *pargc -= index; *pargv += index; }