gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master f2ccd6e 12/62: Table: Completion, fix reading


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master f2ccd6e 12/62: Table: Completion, fix reading fits column
Date: Thu, 13 May 2021 22:20:46 -0400 (EDT)

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

    Table: Completion, fix reading fits column
---
 bin/table/completion.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/bin/table/completion.sh b/bin/table/completion.sh
index be64325..9f2deff 100644
--- a/bin/table/completion.sh
+++ b/bin/table/completion.sh
@@ -19,12 +19,13 @@ _gnuastro_autocomplete_fits_hdu_read(){
 
 _gnuastro_autocomplete_list_fits_files(){
     # Suggest all 'FITS' files in current directory. Case insensitive.
-    COMPREPLY=($(compgen -f -X "!*.[fF][iI][tT][sS]"));
+    COMPREPLY=($(compgen -f -X "!*.[fF][iI][tT][sS]" -- $word));
 }
 
 _gnuastro_autocomplete_list_columns(){
     #
-    COMPREPLY=($(compgen -W "$($ASTTABLE --information gaia.fits | awk -v 
regex="^[0-9]+" 'match($0, regex) {print $2}')" -- "$word"))
+    local fits_file="$("${COMP_WORDS[@]}" | awk -v 
regex="([a-z]|[A-Z])*.[fF][iI][tT][sS]" 'match($0, regex) {print substr($0, 
RSTART, RLENGTH)}')"
+    COMPREPLY=($(compgen -W "$($ASTTABLE --information $fits_file | awk -v 
regex="^[0-9]+" 'match($0, regex) {print $2}')" -- "$word"))
 }
 
 _gnuastro_autocomplete_expect_number(){



reply via email to

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