[geos-commits] [SCM] GEOS branch main updated. 921f88d1e829f8114c2ff1ccd4fa7858960e880f

git at osgeo.org git at osgeo.org
Tue Sep 14 03:35:46 PDT 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  921f88d1e829f8114c2ff1ccd4fa7858960e880f (commit)
      from  967bbb23eb5735e6755fefb3dcb11c4b34ac677e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 921f88d1e829f8114c2ff1ccd4fa7858960e880f
Author: Sandro Santilli <strk at kbt.io>
Date:   Tue Sep 14 12:35:09 2021 +0200

    Make geosop be nice upon being called with unknown switch
    
    Print an error and exit with failure, rather than aborting.
    Closes #1125

diff --git a/util/geosop/GeosOp.cpp b/util/geosop/GeosOp.cpp
index c1bc0f5..a74bcac 100644
--- a/util/geosop/GeosOp.cpp
+++ b/util/geosop/GeosOp.cpp
@@ -76,7 +76,13 @@ int main(int argc, char** argv) {
     ;
 
     options.parse_positional({"opName", "opArgs"});
-    auto result = options.parse(argc, argv);
+    cxxopts::ParseResult result;
+    try {
+        result = options.parse(argc, argv);
+    } catch ( cxxopts::option_not_exists_exception& ex ) {
+        std::cerr << ex.what() << std::endl;
+        exit(1);
+    }
 
     if (argc <= 1 || result.count("help")) {
         std::cout << "geosop - GEOS " << geosversion() << std::endl;

-----------------------------------------------------------------------

Summary of changes:
 util/geosop/GeosOp.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list