matreshka_league_21.0.0_0c8f4d47/tools/ayacc/src/command_line_interface-read_command_line.adb

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--with Ada.Text_IO; 
with Ada.Command_Line;      use Ada.Command_Line;
separate (Command_Line_Interface)

procedure Read_Command_Line (Command_Args : out Command_Line_Type) is

  -- mytest
  --Maximum_Command_Length : constant := 1024;

  --subtype Command_Line_Type is String (1 .. Maximum_Command_Length);
  --Command_Args :  Command_Line_Type;
  -- mytest

  last : integer := command_args'first - 1;

  procedure put ( s : string ) is
  begin
    command_args ( last+1.. last+s'length) := s;
    last := last + s'length;
  end;

begin

  for i in 1 .. Ada.Command_Line.Argument_count -- - 1
  loop
    if i/=1 then 
       put(" "); end if;
    put (  Ada.Command_Line.argument(i) );
  end loop;

  command_args (last+1..command_args'last) := ( others => ' ' );
--  Ada.Text_IO.Put_Line(Command_Args);
end Read_Command_Line;