Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print UTF-8 strings using GNAT.IO in Alr.Commands subsystem #1458

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/alr/alr-commands-init.adb
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ package body Alr.Commands.Init is
Info.Name := To_Unbounded_String (Tentative_Name);
exit;
else
Ada.Text_IO.Put_Line
Put_Line
("Invalid crate name '"
& Tentative_Name & "': "
& Alire.Error_In_Name (Tentative_Name));
Expand Down Expand Up @@ -406,13 +406,13 @@ package body Alr.Commands.Init is
if SPDX.Valid (SP) then
return True;
else
Ada.Text_IO.Put_Line
Put_Line
("Invalid SPDX license expression '" & Str
& "': " & SPDX.Error (SP));
Ada.Text_IO.Put_Line
Put_Line
("SPDX expression expected (https://spdx.org/licenses/).");
Ada.Text_IO.Put_Line ("(Use 'custom-' prefix for custom"
& " license identifier)");
Put_Line ("(Use 'custom-' prefix for custom"
& " license identifier)");

return False;
end if;
Expand Down Expand Up @@ -487,9 +487,9 @@ package body Alr.Commands.Init is
function Description_Validation (Str : String) return Boolean is
begin
if Str'Length > Alire.Max_Description_Length then
Ada.Text_IO.Put_Line ("Description too long:"
& Str'Length'Img & " (max"
& Alire.Max_Description_Length'Img & ")");
Put_Line ("Description too long:"
& Str'Length'Img & " (max"
& Alire.Max_Description_Length'Img & ")");
return False;
else
return True;
Expand Down Expand Up @@ -527,7 +527,7 @@ package body Alr.Commands.Init is
Tag_Error : constant String := Alire.Utils.Error_In_Tag (Elt);
begin
if Tag_Error /= "" then
Ada.Text_IO.Put_Line (Tag_Error);
Put_Line (Tag_Error);
Tags_Ok := False;
end if;
end;
Expand Down
1 change: 0 additions & 1 deletion src/alr/alr-commands-run.adb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ package body Alr.Commands.Run is

procedure Check_Report (Cmd : in out Command;
Exe_Name : String) is
use Ada.Text_IO;

Found_At : constant AAA.Strings.Vector :=
Files.Locate_File_Under (Cmd.Root.Path,
Expand Down
1 change: 0 additions & 1 deletion src/alr/alr-commands.adb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line;
with Ada.Directories;
with Ada.Environment_Variables;
with Ada.Text_IO; use Ada.Text_IO;

with CLIC.TTY;
with CLIC.User_Input;
Expand Down
15 changes: 9 additions & 6 deletions src/alr/alr-commands.ads
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ with Alire.Version;

with CLIC.Subcommand;

private with Ada.Text_IO;
private with GNAT.IO;
private with CLIC.Subcommand.Instance;

private with Alr.OS_Lib; -- For the benefit of many child packages that use it
Expand Down Expand Up @@ -122,11 +122,14 @@ private

-- Common generalities

procedure New_Line (Spacing : Ada.Text_IO.Positive_Count := 1)
renames Ada.Text_IO.New_Line;
procedure New_Line (Spacing : Positive := 1)
renames GNAT.IO.New_Line;

procedure Put_Line (S : String)
renames Ada.Text_IO.Put_Line;
renames GNAT.IO.Put_Line;

procedure Put (S : String)
renames GNAT.IO.Put;

procedure Put_Error (Str : String);
procedure Set_Global_Switches
Expand All @@ -135,8 +138,8 @@ private
package Sub_Cmd is new CLIC.Subcommand.Instance
(Main_Command_Name => "alr",
Version => Alire.Version.Current,
Put => Ada.Text_IO.Put,
Put_Line => Ada.Text_IO.Put_Line,
Put => GNAT.IO.Put,
Put_Line => GNAT.IO.Put_Line,
Put_Error => Put_Error,
Error_Exit => OS_Lib.Bailout,
Set_Global_Switches => Set_Global_Switches,
Expand Down
Loading