-
Notifications
You must be signed in to change notification settings - Fork 108
Command line interface (CLI) #135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I would go with FLAP. But we have to make it an fpm package first, so that we can use it as a dependency. Update: that actually might not be as easy without refactoring... Looking at M_cli, it actually seems much easier to create an fpm package out of it. So we might start with M_cli, and then if FLAP can be made an fpm package, we can switch to it. |
M_cli is already an fpm package (I tried it--it works). However, after reviewing M_cli in more detail, I'm quite strongly in favor of FLAP. It seems more mature and powerful while in my opinion having a simpler API. @szaghi would you accept a PR to FLAP that would make it an fpm package? We'd make sure that your existing build systems (CMake, Make, Fobis) still work. This would require adding an fpm.toml file to the top-level directory, and some adjustments to module names or source file names, but otherwise it would be backward compatible from user's point of view. Best part, it would make FLAP part of a rapidly growing fpm ecosystem of packages. |
I haven't had a chance to look at either of the libraries, but that is definitely the way to go. We need to do whatever can help us bootstrap this faster. Note: the command line for fpm is quite complicated; subcommands, flags that are only applicable for a subset of them, some flags which may be mutually exclusive, etc. I think the first step, before we start implementing the command line interface is to clearly spec it out. Then we can pick a library and start implementing. |
I am aware of two more libraries for command line interfaces:
|
I would like all fpm dependencies to be MIT or BSD licensed, because we are linking everything statically into one executable, so GPL (and even LGPL) would prohibit us to license fpm under the MIT license. |
Wouldn't it be useful to integrate such a library first (or simultaneously) in |
One more library I learned of recently is libSUFR (libSUFR is a library containing Some Useful Fortran Routines). It is also GPL. The M_cli module from @urbanjost is licensed under the Unlicense. The way I understand the licensing system of FLAP:
fpm would count as a FOSS project, since the source is public. Am I correct? |
I think that strictly only GPL family of software is FOSS. We are just OSS :) I'm pretty sure that @szaghi meant "use whatever license you want". He can confirm this. |
@jvdp1 yes, |
Just as an alternative idea, we could also wrap one of the many existing C and C++ libraries:
I think with the current Haskell version of fpm this would require a custom Makefile. |
Yes, I investigated all options for C++, and most of them work, and I settled with using CLI11 for LFortran. Works great. |
How to implement the CLI in fpm-fortran? We can use:
command_argument_count
andget_command_argument
(lowest level, no dependencies)I think we should go with a library and both FLAP and M_cli seem to do what we need (positional arguments + optional flags). What do you think?
The text was updated successfully, but these errors were encountered: