gnuastro-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-devel] [task #14300] Option management using new root data str


From: Mohammad Akhlaghi
Subject: [gnuastro-devel] [task #14300] Option management using new root data structure.
Date: Wed, 4 Jan 2017 23:58:22 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Update of task #14300 (project gnuastro):

                 Summary: gnuastro.conf for common option, better .conf
file/option management => Option management using new root data structure.

    _______________________________________________________

Follow-up Comment #2:

I just noticed that since we are using GNU C Library's Argp
<https://www.gnu.org/software/libc/manual/html_node/Argp.html> for parsing of
arguments, we can use the each programs' argp_option
<https://www.gnu.org/software/libc/manual/html_node/Argp-Option-Vectors.html>
array (and the `gal_commonargs_options' in `lib/commonargs.h' for the common
options) to look up all the long option names automatically.  

Since the `argp_option' array is statically defined, we can easily get the
number of elements in it with ((sizeof options)/(sizeof options[0])) and parse
over them to pull out the option names that were not set on the command-line
and put them in a list to pass onto the library function as suggested below. 

This will make each program's `args.h' the only place where the long option
names are mentioned, greatly simplifying the process of reading in options.
With the programs essentially shrinking to library calls, this will make the
creation of new programs or management of existing ones an order of magnitude
more easier than before and most importantly the code will be much more
elegant.

I don't have the time to do this now, so if you are up for the challenge, you
are most welcome to start working on it, I would be very happy to help ;-).

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/task/?14300>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]