Commit 32b99014 by Jerome Lambourg Committed by Arnaud Charlet

g-comlin.adb (Set_Command_Line): Now that aliases can contain parameters, always…

g-comlin.adb (Set_Command_Line): Now that aliases can contain parameters, always specify the expected separator.

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

	* g-comlin.adb (Set_Command_Line): Now that aliases can contain
	parameters, always specify the expected separator.

From-SVN: r138780
parent c9b99571
...@@ -1295,13 +1295,19 @@ package body GNAT.Command_Line is ...@@ -1295,13 +1295,19 @@ package body GNAT.Command_Line is
-- Add it with no parameter, if that's the way the user -- Add it with no parameter, if that's the way the user
-- wants it. -- wants it.
-- Specify the separator in all cases, as the switch might
-- need to be unaliased, and the alias might contain
-- switches with parameters.
if Section = null then if Section = null then
Add_Switch Add_Switch
(Cmd, Switch_Char & Full_Switch (Parser)); (Cmd, Switch_Char & Full_Switch (Parser),
Separator => Separator (Parser));
else else
Add_Switch Add_Switch
(Cmd, Switch_Char & Full_Switch (Parser), Section.all); (Cmd, Switch_Char & Full_Switch (Parser),
Separator => Separator (Parser),
Section => Section.all);
end if; end if;
end; end;
end loop; end loop;
...@@ -1439,9 +1445,17 @@ package body GNAT.Command_Line is ...@@ -1439,9 +1445,17 @@ package body GNAT.Command_Line is
if not Require_Parameter (Cmd.Config.Switches (S).all) if not Require_Parameter (Cmd.Config.Switches (S).all)
or else Last >= Param or else Last >= Param
then then
if Idx = Group'First and then Last = Group'Last then if Idx = Group'First
and then Last = Group'Last
and then Last < Param
then
-- The group only concerns a single switch. Do not -- The group only concerns a single switch. Do not
-- perform recursive call. -- perform recursive call.
-- Note that we still perform a recursive call if
-- a parameter is detected in the switch, as this
-- is a way to correctly identify such a parameter
-- in aliases.
return False; return False;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment