aboutsummaryrefslogtreecommitdiff
path: root/test/filename.adb
blob: 937fba40a803c1635d966b8080163fa632267a79 (plain)
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
34
35
36
37
38
39
40


--  Programmed by Jedidiah Barber
--  Released into the public domain


with

    Ada.Command_Line,
    Ada.Text_IO,
    FLTK.Filenames;


procedure Filename is

    package ACom  renames Ada.Command_Line;
    package TIO   renames Ada.Text_IO;
    package Fil   renames FLTK.Filenames;

begin

    TIO.Put_Line ("Test program for FLTK filename absolute and expand functions.");
    TIO.New_Line;
    TIO.Put ("Input: ");

    if ACom.Argument_Count /= 1 then
        TIO.Put_Line ("Error: Need exactly one filename argument.");
        ACom.Set_Exit_Status (ACom.Failure);
        return;
    end if;

    TIO.Put_Line (ACom.Argument (1));
    TIO.New_Line;

    TIO.Put_Line ("Absolute: " & Fil.Absolute (ACom.Argument (1)));
    TIO.Put_Line ("Expanded: " & Fil.Expand (ACom.Argument (1)));

end Filename;