gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 0e382bc 11/62: Table: Completion, suggest colu


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 0e382bc 11/62: Table: Completion, suggest columns inside fits
Date: Thu, 13 May 2021 22:20:46 -0400 (EDT)

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

    Table: Completion, suggest columns inside fits
---
 bin/table/completion.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/bin/table/completion.sh b/bin/table/completion.sh
index d17b3a2..be64325 100644
--- a/bin/table/completion.sh
+++ b/bin/table/completion.sh
@@ -22,8 +22,9 @@ _gnuastro_autocomplete_list_fits_files(){
     COMPREPLY=($(compgen -f -X "!*.[fF][iI][tT][sS]"));
 }
 
-_gnuastro_autocomplete_column_read(){
-    echo "Pass"
+_gnuastro_autocomplete_list_columns(){
+    #
+    COMPREPLY=($(compgen -W "$($ASTTABLE --information gaia.fits | awk -v 
regex="^[0-9]+" 'match($0, regex) {print $2}')" -- "$word"))
 }
 
 _gnuastro_autocomplete_expect_number(){
@@ -68,6 +69,7 @@ _gnuastro_asttable_completions(){
 
     case "$prev" in
         -i|--information) _gnuastro_autocomplete_list_fits_files ;;
+        -c|--column) _gnuastro_autocomplete_list_columns ;;
         -b|--noblank) ;;
         -h|--hdu) ;;
         # The default case populates suggestions with all options available



reply via email to

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