Search by property
This commit is contained in:
@@ -62,4 +62,30 @@ package body Alire.Releases is
|
||||
end if;
|
||||
end Print;
|
||||
|
||||
-----------------------
|
||||
-- Property_Contains --
|
||||
-----------------------
|
||||
|
||||
function Property_Contains (R : Release; Str : String) return Boolean is
|
||||
use Utils;
|
||||
|
||||
Search : constant String := To_Lower_Case (Str);
|
||||
begin
|
||||
for P of R.Props loop
|
||||
declare
|
||||
Text : constant String :=
|
||||
To_Lower_Case
|
||||
((if Utils.Contains (P.Image, ":")
|
||||
then Utils.Tail (P.Image, ':')
|
||||
else P.Image));
|
||||
begin
|
||||
if Utils.Contains (Text, Search) then
|
||||
return True;
|
||||
end if;
|
||||
end;
|
||||
end loop;
|
||||
|
||||
return False;
|
||||
end Property_Contains;
|
||||
|
||||
end Alire.Releases;
|
||||
|
||||
Reference in New Issue
Block a user