Github user andrzejdoro commented on a diff in the pull request:
https://github.com/apache/guacamole-server/pull/205#discussion_r238983038
--- Diff: src/guacd/conf-args.c ---
@@ -122,3 +128,15 @@ int guacd_conf_parse_args(guacd_config* config, int
argc, char** argv) {
}
+const char* guacd_conf_get_path(int argc, char** argv) {
+
+ /* Find -c option */
+ int i;
+ for(i=1; i<argc-1; i++) {
+ if(strcmp("-c", argv[i]) == 0) return argv[i+1];
--- End diff --
> I really don't like the idea of ignoring `-c` initially and manually
re-parsing the arguments later. There has to be a better way.
More precisely, it's the other way round: at first we manually search for
`-c` (then load config) and then we parse all the arguments. Nevertheless, I'm
not happy with this solution either, but it seems that _getopt()_ is not
helping.
> What about parsing any file specified with `-c` immediately upon reading
that `-c`?
That's a nice solution! I'm not sure whether it's quite common behaviour,
but we can try it. :+1:
---