gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master e1c1a4b 18/62: Table: Completion, fix 'wcshdu'


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master e1c1a4b 18/62: Table: Completion, fix 'wcshdu'
Date: Thu, 13 May 2021 22:20:47 -0400 (EDT)

branch: master
commit e1c1a4bc25b78e8619e692270a3f4f9a15f4acac
Author: Pedram Ashofteh Ardakani <pedramardakani@pm.me>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Table: Completion, fix 'wcshdu'
    
    Until now, the 'wcshdu' option would work only without the equal sign.
    With this commit, the 'compgen' will cease to filter out the words that
    do not match the current word. This is because when the cursor is just
    after the equal sign '=', it will be considered as the current word. And
    none of the options contain '='. Hence, all of them will be removed from
    suggestions.
    
    Also, a short description of the 'wcshdu' command is added.
---
 bin/table/completion.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/table/completion.sh b/bin/table/completion.sh
index 113c09d..8f491d3 100644
--- a/bin/table/completion.sh
+++ b/bin/table/completion.sh
@@ -26,7 +26,7 @@ _gnuastro_autocomplete_list_fits_hdu(){
     # Accepts a fits filename as input and suggests its headers
     if [[ -f "$1"  ]]; then
         local list="$($ASTFITS --quiet $1 | awk '{print $2}')"
-        COMPREPLY=($(compgen -W "$list" -- "$word"))
+        COMPREPLY=($(compgen -W "$list"))
     fi
 }
 
@@ -132,7 +132,10 @@ _gnuastro_asttable_completions(){
             # something is going wrong.
             _gnuastro_autocomplete_list_fits_columns "$fits_name"
             ;;
-        -W|--wcshdu) _gnuastro_autocomplete_list_fits_hdu "$fits_name" ;;
+        -W|--wcshdu)
+            # Description is same as the '--column' option.
+            _gnuastro_autocomplete_list_fits_hdu "$fits_name"
+            ;;
         -b|--noblank) ;;
         -h|--hdu) ;;
         *) _gnuastro_autocomplete_list_options $PROG_NAME ;;



reply via email to

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