Skip to content

Commit

Permalink
show
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Jun 13, 2024
1 parent d00f5da commit ec2c2e5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/show_available.f90
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module forsus__available
!! Show what substances are available in the database
contains
subroutine show_available(sus)
!! Show the available substances in the database
use forsus_constants, only: forsus_dir, forsus_default_dir
character(len=*), optional, intent(in out) :: sus
integer :: funit

character(len=*), parameter :: pst_command="| fzf | cut -d'.' -f1 > /tmp/forsus"


if (allocated(forsus_dir)) then
call system("ls " // forsus_dir // pst_command)
else
call system("ls " // forsus_default_dir // pst_command)
end if

if (present(sus)) then
open(newunit=funit, file="/tmp/forsus")
read(funit, "(A)") sus
close(funit)
end if
end subroutine
end module

0 comments on commit ec2c2e5

Please sign in to comment.