CL. Comand Line - JulTob/Ada GitHub Wiki
The Comand Line Is one of the main services you need to know to produce Linux OS modules.
The pipe works by Arguments.
with Ada.Command_Line;
-- THese two next will come in handy
with Ada.Text_IO;
with Ada.Strings.Unbounded;
package CL renames Ada.Command_Line;
Package SU renames Ada.Strings.Unbounded; use type SU.Unbounded_String;
Command_Error: exception;
-- Check input size -- Always!
if CL.Argument_Count /= 1 then
-- Only accept Call with no arguments
raise Command_Error;
end if;
-- Access Arguments
Put( CL.Argument(1) )
-- CL.Argument is an array of strings, with the words of the call
---- CL.Argument(1) is the name of the program
exception
when Command_Error =>
Ada.Text_IO.Put_Line("Use: ");
Ada.Text_IO.Put_Line(" " & CL.Command_Name & " <file>");