g-comlin.adb (Define_Switch, [...]): New.
authorArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Aug 2008 08:33:21 +0000 (10:33 +0200)
committerArnaud Charlet <charlet@gcc.gnu.org>
Wed, 6 Aug 2008 08:33:21 +0000 (10:33 +0200)
commitf9325b0364fdef06a5168eb809c6e8ae0bf658a0
treebf253ff6c0ad14f839a0965ef719d58c602a7055
parent1c5a12b418a7d8db0384c83dd1ac47adb80581c9
g-comlin.adb (Define_Switch, [...]): New.

2008-08-06  Jerome Lambourg  <lambourg@adacore.com>

* g-comlin.adb (Define_Switch, Get_Switches): New.
(Can_Have_Parameter, Require_Parameter, Actual_Switch): New, used when
ungrouping switches.
(For_Each_Simple_Switch): Allow more control over parameters handling.
This generic method now allows ungrouping of switches with parameters
and switches with more than one letter after the prefix.
(Set_Command_Line): Take care of switches that are prefixed with a
switch handling parameters without delimiter (-gnatya and -gnaty3 for
example).
(Add_Switch, Remove_Switch): Handle parameters possibly present inside
a group, as in gnaty3aM80 (3 and 80 are parameters). Report status of
the operation.
(Start, Alias_Switches, Group_Switches): Take care of parameters
possibly present inside a group.

* g-comlin.ads (Define_Switch): New method used to define a list of
expected switches, that are necessary for correctly ungrouping switches
with more that one character after the prefix.
(Get_Switches): Method that builds a getopt string from the list of
switches as set previously by Define_Switch.
(Add_Switch, Remove_Switch): New versions of the methods, reporting the
status of the operation. Also allow the removal of switches with
parameters only.
(Command_Line_Configuration_Record): Maintain a list of expected
switches.

From-SVN: r138775
gcc/ada/ChangeLog
gcc/ada/g-comlin.adb
gcc/ada/g-comlin.ads