]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Better exception message on Invalid_Switch exception
authorpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Aug 2019 08:06:24 +0000 (08:06 +0000)
committerpmderodat <pmderodat@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 13 Aug 2019 08:06:24 +0000 (08:06 +0000)
Improve the error message introduced in the recent commit for
Invalid_Switch exception.

2019-08-13  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* libgnat/g-comlin.adb (Getopt): Quote unrecognized switch in
Invalid_Switch exception message.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@274333 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/libgnat/g-comlin.adb

index 5b88950ace1a31b20719f756ea4f395d7cd5f439..eab24a04a5cef1a62b98ab682c273d86779ed513 100644 (file)
@@ -1,3 +1,8 @@
+2019-08-13  Dmitriy Anisimkov  <anisimko@adacore.com>
+
+       * libgnat/g-comlin.adb (Getopt): Quote unrecognized switch in
+       Invalid_Switch exception message.
+
 2019-08-13  Yannick Moy  <moy@adacore.com>
 
        * sem_util.adb (Traverse_More_Func): Take into account
index f567ddb2481e9953226afc16ad1b3fcb5633398b..e3fac5bc82f1c566723c37fccbde72ca08df6cdb 100644 (file)
@@ -754,7 +754,7 @@ package body GNAT.Command_Line is
             Parser.Current_Index := End_Index + 1;
 
             raise Invalid_Switch with
-              "Unrecognized option " & Full_Switch (Parser);
+              "Unrecognized option '" & Full_Switch (Parser) & ''';
          end if;
 
          End_Index := Parser.Current_Index + Max_Length - 1;
@@ -885,7 +885,7 @@ package body GNAT.Command_Line is
                      Extra   => Parser.Switch_Character);
                   Parser.Current_Index := Arg'Last + 1;
                   raise Invalid_Switch with
-                    "Unrecognized option " & Full_Switch (Parser);
+                    "Unrecognized option '" & Full_Switch (Parser) & ''';
                end if;
          end case;