taskGNU Astronomy Utilities - Tasks: task #16365, Prefix for variables in...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

task #16365: Prefix for variables in configuration files

Submitter:  Mohammad Akhlaghi <makhlaghi>
Submitted:  Sun 07 May 2023 12:40:21 PM UTC
   
 
Should Start On:  Sat 06 May 2023 11:00:00 PM UTC Should be Finished on:  Sat 06 May 2023 11:00:00 PM UTC
Category:  All Gnuastro Priority:  5 - Normal
Item Group:  Configuration file Status:  Done
Privacy:  Public Assigned to:  makhlaghi
Percent Complete:  100% Open/Closed:  Closed
Effort:  0.00

Sun 07 May 2023 11:15:12 PM UTC, comment #2: 

This task has been implemented in Commit 41302705.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 07 May 2023 12:42:44 PM UTC, comment #1: 

A small typo in the second 'astnoisechisel' call: '--config-prefix=abc-' should have been '--config-prefix=def-'.

Also, note that this was mainly written with Makefiles in mind (hence the usage of '-' within the name). For loading them as shell variables, we can't use that! One common alternative is to use '_' in the shell.

Mohammad Akhlaghi <makhlaghi>
Group administrator
Sun 07 May 2023 12:40:21 PM UTC, original submission:  

With the recent Commit dfa2583c6, it is now possible for users to load configuration files into their shell or Makefiles.

However, in case they have multiple calls to a program, the names of the options within the configuration files may conflict with each other!

We can fix this problem with a single common option to all Gnuastro programs: '--config-prefix=STR'. When this option is given, the program will accept option names with 'STR' as prefix, and remove 'STR' when the rest of the option name is a standard name. For example:


$ cat nc-abc.conf
abc-tilesize=25,25

$ cat nc-def.conf
def-tilesize=25,25

$ astnoisechisel img1.fits --config=nc-abc.conf --config-prefix=abc-

$ astnoisechisel img2.fits --config=nc-def.conf --config-prefix=abc-


Later, the user can easily load both config files into their shell with 'source' and use them with the prefixed names within the shell or Makefile :-).

Mohammad Akhlaghi <makhlaghi>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by makhlaghi (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-05-07 makhlaghi StatusNone Done
        Percent Complete0% 100%
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code