with Text_Io;
package body Command_Line_Handler is

    Command_Line_File_Name : constant String := "COMMAND_LINE.TXT";
    Command_File : Text_Io.File_Type;


    procedure Reset is
    begin
        if Text_Io.Is_Open (Command_File) then
            Text_Io.Close (Command_File);
        end if;
    end Reset;

    procedure Next_Word (Word : out String; Length : out Natural) is
    begin
        if not Text_Io.Is_Open (Command_File) then
            begin
                Text_Io.Open (Command_File, Text_Io.In_File,
                              Command_Line_File_Name);
            exception
                when others =>
                    raise No_Command_Line_File;
            end;
        end if;
        Text_Io.Get_Line (Command_File, Word, Length);
    exception
        when No_Command_Line_File =>
            raise;
        when others =>
            raise No_More_Words;
    end Next_Word;

end Command_Line_Handler;