Function request
Hi this is a great addon for Fortran programmer. I am hoping it can be even further enhanced/
- allow multiple arguments after a switch:
myapp --range 1.0 2.0ormyapp -r 1.0 2.0This can be achieved by adding another parameter in theoption_sstruct such asnopts. Default can be nopts == 0 for no argument. - allow repeating switch:
myapp --add file1 --add file2and provide the occurrence ofadd
Are these implemented? If not, can you implement them? If you do not have time, I can help implement these through a pull request.
Thank you so much!
some thing very interesting:
using ifort on windows, it will stop after paring the first option using the example
however, it runs fine, if you change the sample by calling the function outside the case selection. gfortran does not have this issue.
do
a = getopt("ab:h", opts)
select case(a)
case(char(0)) ! When all options are processed
exit
case("a")
print*, "option alpha/a"
case("b")
print*, "option beta/b=", trim(optarg) ! "trim" is quite useful to avoid trailing blanks
case("h")
print*, "help-screen"
end select
end do
Are these implemented? If not, can you implement them?
No, not at the moment.
"I can help implement these through a pull request."
Feel free to do so. Thanks, Hani