In some common use cases, gnatls used to return E_Fatal error code, which was
unfriendly for analysis. It has been changed as follows:
 "gnatls -v" and default runtime exists, or
 "gnatls -v --RTS=<good runtime path>" - now returns E_Success
 "gnatls -v" and no default runtime exists - now returns E_Warnings
 "gnatls", "gnatls -h" - now returns E_Success

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-11-07  Vasiliy Fofanov  <fofa...@adacore.com>

        * gnatls.adb: Lower severity of the program's return value in
        some common cases.

Index: gnatls.adb
===================================================================
--- gnatls.adb  (revision 217215)
+++ gnatls.adb  (working copy)
@@ -1663,6 +1663,7 @@
            ("Default runtime not available. Use --RTS= with a valid runtime");
          Write_Eol;
          Write_Eol;
+         Exit_Status := E_Warnings;
       end if;
 
       Write_Str ("Source Search Path:");
@@ -1775,10 +1776,11 @@
             Usage;
          else
             Try_Help;
+            Exit_Status := E_Fatal;
          end if;
       end if;
 
-      Exit_Program (E_Fatal);
+      Exit_Program (Exit_Status);
    end if;
 
    Initialize_ALI;

Reply via email to