Comments
Patch
===================================================================
@@ -1769,20 +1769,28 @@
-- -vPx Specify verbosity while parsing project files
- elsif Argv'Length = 4
- and then Argv (Argv'First + 1 .. Argv'First + 2) = "vP"
- then
- case Argv (Argv'Last) is
- when '0' =>
- Current_Verbosity := Prj.Default;
- when '1' =>
- Current_Verbosity := Prj.Medium;
- when '2' =>
- Current_Verbosity := Prj.High;
- when others =>
- Fail ("Invalid switch: " & Argv.all);
- end case;
+ elsif Argv (Argv'First + 1 .. Argv'First + 2) = "vP" then
+ if Argv'Length = 4
+ and then Argv (Argv'Last) in '0' .. '2'
+ then
+ case Argv (Argv'Last) is
+ when '0' =>
+ Current_Verbosity := Prj.Default;
+ when '1' =>
+ Current_Verbosity := Prj.Medium;
+ when '2' =>
+ Current_Verbosity := Prj.High;
+ when others =>
+ -- Cannot happen
+
+ raise Program_Error;
+ end case;
+ else
+ Fail ("invalid verbosity level: "
+ & Argv (Argv'First + 3 .. Argv'Last));
+ end if;
+
Remove_Switch (Arg_Num);
-- -Pproject_file Specify project file to be used
===================================================================
@@ -7825,11 +7825,12 @@
-- -vPx (verbosity of the parsing of the project files)
- elsif Argv'Last = 4
- and then Argv (2 .. 3) = "vP"
- and then Argv (4) in '0' .. '2'
- then
- if And_Save then
+ elsif Argv (2 .. 3) = "vP" then
+ if Argv'Last /= 4 or else Argv (4) not in '0' .. '2' then
+ Make_Failed
+ ("invalid verbosity level " & Argv (4 .. Argv'Last));
+
+ elsif And_Save then
case Argv (4) is
when '0' =>
Current_Verbosity := Prj.Default;