Stdlib: Argument parser for executables

Created on 8 Sep 2020  路  5Comments  路  Source: fortran-lang/stdlib

Could this be a place to provide an argument parser in fortran?

Here are two implementations:

Most helpful comment

I've found the link for the one from @everythingfunctional:

There has also been a discussion of available modules for option parsing in https://github.com/fortran-lang/fpm/issues/135. Three more libraries I mentioned in that thread are:

I also believe that many of the libraries in the list of popular Fortran projects have their own argument parsers.

Given this much prior art, I think it is a good idea to draw up some kind of comparison table and identify what are the most commonly required features, and what kind of different programming approaches are used in practice.

All 5 comments

Yes, I think argument parsing is in scope. See also:

I've found the link for the one from @everythingfunctional:

There has also been a discussion of available modules for option parsing in https://github.com/fortran-lang/fpm/issues/135. Three more libraries I mentioned in that thread are:

I also believe that many of the libraries in the list of popular Fortran projects have their own argument parsers.

Given this much prior art, I think it is a good idea to draw up some kind of comparison table and identify what are the most commonly required features, and what kind of different programming approaches are used in practice.

I think we all agree that stdlib should have command line parsing.

One way to get there is to first implement it as a separate library as an fpm package, and get projects use it, and then eventually include into stdlib as we get more real life usage, to ensure the API works.

AFAICT, https://github.com/urbanjost/M_CLI2 already provides a fpm package.

I did not quite get hooked into the process so I do not think that will be pulled in, but yes .. I made a branch that implemented all the command line parsing in the current FPM and all the functionality except the pull/curl request, and tdetermining the compilation order was primitive but I made that private so I could continue experimenting while the more critical TOML interface and gitlib/libcurl/system interfaces seemed to be racing along, and others seemed to be working on the CLI interface. Apparently I did not remove everything I thought I did. So the fpm CLI interface is gone from the M_CLI2 site but if anyone wants me to integrate that into a more recent fpm package let me know.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jvdp1 picture jvdp1  路  4Comments

certik picture certik  路  9Comments

certik picture certik  路  5Comments

cmacmackin picture cmacmackin  路  9Comments

EverLookNeverSee picture EverLookNeverSee  路  11Comments