gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master d1b82e78: fits-view: fixed typo that didn't le


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master d1b82e78: fits-view: fixed typo that didn't let some short options get parsed
Date: Mon, 3 Jun 2024 14:40:59 -0400 (EDT)

branch: master
commit d1b82e78dc2a086a965c16276980427f7f6635d8
Author: Giacomo Lorenzetti <glorenzetti@cefca.es>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    fits-view: fixed typo that didn't let some short options get parsed
    
    Until now, some of the options would not work in their short format because
    the removal of the short format string assumed the wrong letter!
    
    With this commit, these typos are corrected.
    
    Note from Mohammad while merging into 'master': a description of the newly
    added '--ds9region' in the previous commit (8eb178da8) has also been added
    to the 'NEWS' file in this commit.
---
 NEWS                    | 9 +++++++++
 bin/script/fits-view.sh | 8 ++++----
 2 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/NEWS b/NEWS
index 9ca75347..ebc9ca7c 100644
--- a/NEWS
+++ b/NEWS
@@ -42,6 +42,10 @@ See the end of the file for license conditions.
     short format of '-g'); similar to the same option in Arithmetic or
     ConvertType.
 
+  --ds9region: load any number of DS9 region files (separated by comas and
+    given to this option) into the DS9 window that will be opened. This was
+    added by Giacomo Lorenzetti.
+
   - The default DS9 'sls' colormap contrast and bias are adjusted so the
     largest value does not have a white color, but is dark red. This was
     done because white is DS9's default color for blank pixels and
@@ -192,6 +196,11 @@ See the end of the file for license conditions.
   - bug #65743: Arithmetic's collapse-number mistakenly calculating
     collapse-median instead. Reported by Sepideh Eskandarlou.
 
+  - bug #65801: astscript-fits-view could not properly parse the short
+    versions of the '--ds9geometry', '--ds9extra', '--ds9center' and
+    '--ds9mode' when the value was touching the short option name. Found
+    and fixed by Giacomo Lorenzetti.
+
   - bug #65822: MakeProfiles does not write negative values with --replace.
 
 
diff --git a/bin/script/fits-view.sh b/bin/script/fits-view.sh
index b979d531..3f20891e 100644
--- a/bin/script/fits-view.sh
+++ b/bin/script/fits-view.sh
@@ -206,22 +206,22 @@ do
         # Output options
         -G|--ds9geometry)     ds9geometry="$2";                    check_v 
"$1" "$ds9geometry"; shift;shift;;
         -G=*|--ds9geometry=*) ds9geometry="${1#*=}";               check_v 
"$1" "$ds9geometry"; shift;;
-        -G*)                  ds9geometry=$(echo "$1"  | sed -e's/-g//');  
check_v "$1" "$ds9geometry"; shift;;
+        -G*)                  ds9geometry=$(echo "$1"  | sed -e's/-G//');  
check_v "$1" "$ds9geometry"; shift;;
         -s|--ds9scale)        ds9scale="$2";                       check_v 
"$1" "$ds9scale"; shift;shift;;
         -s=*|--ds9scale=*)    ds9scale="${1#*=}";                  check_v 
"$1" "$ds9scale"; shift;;
         -s*)                  ds9scale=$(echo "$1"  | sed -e's/-s//');  
check_v "$1" "$ds9scale"; shift;;
         -e|--ds9extra)        ds9extratmp="$2";                    check_v 
"$1" "$ds9extratmp"; shift;shift;;
         -e=*|--ds9extra=*)    ds9extratmp="${1#*=}";               check_v 
"$1" "$ds9extratmp"; shift;;
-        -e*)                  ds9extratmp=$(echo "$1"  | sed -e's/-s//');  
check_v "$1" "$ds9extratmp"; shift;;
+        -e*)                  ds9extratmp=$(echo "$1"  | sed -e's/-e//');  
check_v "$1" "$ds9extratmp"; shift;;
         -c|--ds9center)       ds9center="$2";                      check_v 
"$1" "$ds9center"; shift;shift;;
         -c=*|--ds9center=*)   ds9center="${1#*=}";                 check_v 
"$1" "$ds9center"; shift;;
-        -c*)                  ds9center=$(echo "$1"  | sed -e's/-s//');  
check_v "$1" "$ds9center"; shift;;
+        -c*)                  ds9center=$(echo "$1"  | sed -e's/-c//');  
check_v "$1" "$ds9center"; shift;;
         -r|--ds9region)       ds9region="$2";                      check_v 
"$1" "$ds9region"; shift;shift;;
         -r=*|--ds9region=*)   ds9region="${1#*=}";                 check_v 
"$1" "$ds9region"; shift;;
         -r*)                  ds9region=$(echo "$1"  | sed -e's/-r//');  
check_v "$1" "$ds9region"; shift;;
         -O|--ds9mode)         ds9mode="$2";                       check_v "$1" 
"$ds9mode"; shift;shift;;
         -O=*|--ds9mode=*)     ds9mode="${1#*=}";                  check_v "$1" 
"$ds9mode"; shift;;
-        -O*)                  ds9mode=$(echo "$1"  | sed -e's/-s//');  check_v 
"$1" "$ds9mode"; shift;;
+        -O*)                  ds9mode=$(echo "$1"  | sed -e's/-O//');  check_v 
"$1" "$ds9mode"; shift;;
         -m|--ds9colorbarmulti)    ds9colorbarmulti=1; shift;;
         -m*|--ds9colorbarmulti=*) on_off_option_error --ds9colorbarmulti -m;;
         -p|--prefix)          prefix="$2";                         check_v 
"$1" "$prefix"; shift;shift;;



reply via email to

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