Search by property

This commit is contained in:
A
2018-02-26 15:34:13 +01:00
parent 86e96bf6b7
commit c0283e2566
5 changed files with 76 additions and 3 deletions
+26
View File
@@ -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;