/* This file is part of Smap. Copyright (C) 2006-2021 Sergey Poznyakoff Smap 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. Smap 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 Smap. If not, see . */ OPTIONS_BEGIN("smapc", [], [<[map key...]>], [], [], []) OPTION(debug, d, LEVEL-SPEC, []) ALIAS(,x) BEGIN if (smap_debug_set(optarg)) smap_error("invalid debug specification: %s", optarg); END OPTION(trace, T,, []) BEGIN smapc_trace_option = 1; END OPTION(prompt, p, STRING, []) BEGIN prompt = optarg; END OPTION(annotate, a,, []) BEGIN annotate = 1; END OPTION(batch, B,, []) BEGIN batch_mode = 1; END OPTION(norc, q,, []) BEGIN norc = 1; END OPTION(source, s, ADDR, []) BEGIN if (inet_aton(optarg, &source_addr) == 0) { smap_error("invalid IP address: %s", optarg); exit(EX_USAGE); } END OPTION(server, S, URL, []) BEGIN server_option = optarg; END OPTION(quiet, Q,, []) BEGIN quiet_startup = 1; END OPTIONS_END void get_options(int argc, char *argv[], int *index) { GETOPT(argc, argv, *index) }