From 4c1b833e271c8bf6aa5643deef2d47a1781444ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Sun, 27 Aug 2017 14:44:17 +0200 Subject: [PATCH] afb-config: Add short -p option for --port MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: Iae8475559ee2381ee7d687c6afc2e6ce7145ebf3 Signed-off-by: José Bollo --- src/afb-config.c | 8 +++++--- src/afb-config.h | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/afb-config.c b/src/afb-config.c index efa86f23..c22dbb5e 100644 --- a/src/afb-config.c +++ b/src/afb-config.c @@ -56,7 +56,6 @@ #define SET_BACKGROUND 2 #define SET_FORGROUND 3 -#define SET_TCP_PORT 5 #define SET_ROOT_DIR 6 #define SET_ROOT_BASE 7 #define SET_ROOT_API 8 @@ -91,6 +90,7 @@ #define SET_TRACEEVT 'E' #define SET_EXEC 'e' #define DISPLAY_HELP 'h' +#define SET_TCP_PORT 'p' #define SET_QUIET 'q' #define SET_RNDTOKEN 'r' #define SET_TRACESVC 'S' @@ -101,7 +101,9 @@ #define SET_VERBOSE 'v' #define SET_WORK_DIR 'w' -#define SHORTOPTS "c:D:E:ehqrT:t:u:Vvw:" +const char shortopts[] = + "c:D:E:ehp:qrT:t:u:Vvw:" +; // Command line structure hold cli --command + help text typedef struct { @@ -418,7 +420,7 @@ static void parse_arguments(int argc, char **argv, struct afb_config *config) } // get all options from command line - while ((optc = getopt_long(argc, argv, SHORTOPTS, gnuOptions, NULL)) != EOF) { + while ((optc = getopt_long(argc, argv, shortopts, gnuOptions, NULL)) != EOF) { switch (optc) { case SET_VERBOSE: verbosity++; diff --git a/src/afb-config.h b/src/afb-config.h index c502dbc1..9e15ca09 100644 --- a/src/afb-config.h +++ b/src/afb-config.h @@ -64,6 +64,7 @@ struct afb_config { unsigned no_ldpaths: 1; /* disable default ldpaths */ unsigned noHttpd: 1; unsigned background: 1; /* run in backround mode */ + unsigned monitoring: 1; /* activates monitoring */ }; extern struct afb_config *afb_config_parse_arguments(int argc, char **argv); -- 2.16.6