Skip to content

Commit

Permalink
Better error message on missing switch argument
Browse files Browse the repository at this point in the history
  • Loading branch information
mosteo committed Feb 17, 2024
1 parent de03300 commit d04d848
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/clic-command_line.adb
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,10 @@ package body CLIC.Command_Line is

else
Parser.Current_Index := End_Index + 1;
raise Invalid_Parameter;
raise Invalid_Parameter with
"Switch "
& Argument (Parser, Parser.Current_Argument)
& " requires argument";
end if;

-- Case of switch of the form <switch> xxx
Expand All @@ -849,7 +852,10 @@ package body CLIC.Command_Line is

else
Parser.Current_Index := End_Index + 1;
raise Invalid_Parameter;
raise Invalid_Parameter with
"Switch "
& Argument (Parser, Parser.Current_Argument)
& " requires argument";
end if;

when Parameter_No_Space =>
Expand Down

0 comments on commit d04d848

Please sign in to comment.