]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
show parameter usage when option processing was unsuccessful
authorAchim Gratz <Stromeko@NexGo.DE>
Sat, 6 Dec 2014 13:22:51 +0000 (13:22 +0000)
committerAchim Gratz <Stromeko@NexGo.DE>
Sat, 6 Dec 2014 13:22:51 +0000 (13:22 +0000)
         * main.cc (WinMain): Show parameter usage before exiting when
         options processing was unsuccessful (this usually means that an
         unknown option was given on the command line).

.cvsignore
ChangeLog
main.cc

index c3460a1b9122e9420ec36349c476f68a2846a9c9..ed0a9a65019c0d00bf4524aec09395fe93cf19a9 100644 (file)
@@ -6,3 +6,4 @@ configure.lineno
 Makefile.in
 GNUmakefile
 make.out
+.git
index b851dc140e343f748f9b568d62a5bb5c6c657c40..5b3db29780b9f840b9943c39c7f5f280fe3226e8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-11-22  Achim Gratz  <Stromeko@nexgo.de>
+
+       * main.cc (WinMain): Show parameter usage before exiting when
+       options processing was unsuccessful (this usually means that an
+       unknown option was given on the command line).
+
 2014-11-20  Corinna Vinschen  <corinna@vinschen.de>
 
        * install.cc (Installer::StandardDirs): Add /etc/fstab.d, /dev,
diff --git a/main.cc b/main.cc
index 44d10e25fa127f554aee712cfa32b5cb875fd5a2..49e5fbc01d183c95ddc5f2ca078dd6e1803c2614 100644 (file)
--- a/main.cc
+++ b/main.cc
@@ -232,7 +232,12 @@ WinMain (HINSTANCE h,
     local_dir = std::string (cwd);
 
     if (!GetOption::GetInstance ().Process (argc,_argv, NULL))
-      exit (1);
+      {
+       GetOption::GetInstance ().ParameterUsage (cerr
+                                                 << "\nError during option processing."
+                                                 << "\nCommand Line Options:\n");
+       exit (1);
+      }
 
     if (!((string) Arch).size ())
       {
This page took 0.044806 seconds and 5 git commands to generate.