-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add a function to read parameters from a file to the parser #38
Comments
Comment by @mlennert on 30 Aug 2018 13:14 UTC If we go for such a parameter file, I would suggest to keep it very simple, i.e. one format, with my preference going to the one used in your example with a simple parameter=value pair per line, maybe with a special treatment of flags to create something like in the python parser, i.e. with the possibility to cite several flags at once:
instead of
|
Comment by @metzm on 30 Aug 2018 17:22 UTC
+1
+1
or simply:
the parser already handles something like Using the example
what is the advantage of the proposed approach over a file that contains exactly this line and executing this file? This is already working and handled by the OS. |
Comment by @wenzeslaus on 31 Aug 2018 00:56 UTC
I'm thinking about these three points:
When I have a long r.series input:
I need to switch to
That of course assumes that
So the following ways of storing the parameters as a command with indentation and backslash which will work well in unix-like command line but not necessarily elsewhere (which is something we need to explain to the user),
would become, e.g., the following YAML file:
Here the advantage is for modules which are implementing some model/simulation which usually have a lot of parameters, e.g. https://grass.osgeo.org/grass77/manuals/r.sim.water (which has over 20 parameters) or G7:r.topmodel (which actually requires a "parameters file"). |
Comment by @wenzeslaus on 31 Aug 2018 01:17 UTC
I don't know if to replace it or not. The thing is that we are adding file option to more and more modules. If the parameter file is available, then not only all modules but all their options too have a solution for the length limit of the command line arguments. That doesn't rule out the file option for convenience and alternative syntax, but you don't needed to implemented just because you need it once. |
Comment by @metzm on 31 Aug 2018 19:39 UTC
You need to switch in any case. It is easier to create a list input names (
I am referring to your example
which works on any OS.
scripting is of course OS dependent and not related to the proposed parameter file option
I am referring to your example
no indentation or backslash
The history would no longer make sense because the parameters of the called modules are no longer recorded in history. In the meantime, the parameter files could be altered, moved, or deleted. In this context, calling a module and creating a script for a specific OS must not be mixed. |
Reported by @wenzeslaus on 30 Aug 2018 03:04 UTC
This is a suggestion to enhance the command line syntax parser to read the parameters from a file if specified.
Benefits:
file
options such as the one in https://grass.osgeo.org/grass77/manuals/r.series..htmlQuestions and challenges:
The usual way:
Using a file:
Interesting? Useful? Terrible? ... Let me know.
Migrated-From: https://trac.osgeo.org/grass/ticket/3632
The text was updated successfully, but these errors were encountered: