[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 50026ec 48/62: Auto-completion: Rename boolean
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 50026ec 48/62: Auto-completion: Rename boolean query functions |
Date: |
Thu, 13 May 2021 22:20:53 -0400 (EDT) |
branch: master
commit 50026ec0a5a6895b3f57642a875008aedef07963
Author: Pedram Ashofteh Ardakani <pedramardakani@pm.me>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Auto-completion: Rename boolean query functions
Until now, functions that validated if a file is FITS or a plaintext
table were named like: _gnuastro_autocomplete_x_is_extension
However, it might be a better naming style as if we were asking the
functions whether the input file is the extension we want or not as:
_gnuastro_autocomplete_is_x_extension (?) and we'd expect a 0 or 1 as
return. With this commit, I have renamed two functions accordingly.
---
bin/table/completion.bash | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/bin/table/completion.bash b/bin/table/completion.bash
index cf2998b..aeb0abb 100644
--- a/bin/table/completion.bash
+++ b/bin/table/completion.bash
@@ -136,7 +136,7 @@ _gnuastro_autocomplete_list_fits_names(){
_gnuastro_autocomplete_list_plaintext_tables(){
local files=($(ls | grep -e "^$word" --color=never))
for f in ${files[*]} ; do
- if _gnuastro_autocomplete_plaintext_is_table "$f"; then
+ if _gnuastro_autocomplete_is_plaintext_table "$f"; then
COMPREPLY+=("$f"); fi
done
}
@@ -149,7 +149,7 @@ _gnuastro_autocomplete_list_plaintext_tables(){
_gnuastro_autocomplete_list_all_valid_files(){
local files=($(ls | grep -e "^$word" --color=never))
for f in ${files[*]} ; do
- if _gnuastro_autocomplete_plaintext_is_table "$f"; then
+ if _gnuastro_autocomplete_is_plaintext_table "$f"; then
COMPREPLY+=("$f"); fi
if $_gnuastro_astfits "$f" -q &> /dev/null; then COMPREPLY+=("$f"); fi
done
@@ -170,7 +170,7 @@ _gnuastro_autocomplete_expect_number(){
# Check if the given file is a FITS file (that can actually be
# opened). Note that FITS files have many possible extensions (see the
# 'gal_fits_name_is_fits' function in 'lib/fits.c').
-_gnuastro_autocomplete_file_is_fits(){
+_gnuastro_autocomplete_is_fits(){
local inputfile="$1"
if $_gnuastro_astfits $inputfile -h0 &> /dev/null; then return 0; else
return 1; fi
}
@@ -234,7 +234,7 @@ _gnuastro_autocomplete_option_value(){
# Return 0 if the given non-FITS file is a table.
-_gnuastro_autocomplete_plaintext_is_table(){
+_gnuastro_autocomplete_is_plaintext_table(){
# For easy reading.
local inputfile="$1"
@@ -284,7 +284,7 @@ _gnuastro_autocomplete_last_table(){
if [ -f $token ]; then
# It is a FITS file.
- if _gnuastro_autocomplete_file_is_fits $token; then
+ if _gnuastro_autocomplete_is_fits $token; then
# See if a HDU has been given or not. If it hasn't been
# given, its safe to assume the first HDU. In this case,
@@ -308,7 +308,7 @@ _gnuastro_autocomplete_last_table(){
# Not a FITS file.
else
- if _gnuastro_autocomplete_plaintext_is_table $token; then
+ if _gnuastro_autocomplete_is_plaintext_table $token; then
last_table="$token"
break;
fi
- [gnuastro-commits] master 7b584a4 31/62: Table: Completion, update shebang, fix formatting, (continued)
- [gnuastro-commits] master 7b584a4 31/62: Table: Completion, update shebang, fix formatting, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master c259040 39/62: bin/table/completion.bash: Fix '--information', Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 6efd4ff 32/62: Book: Add auto-complete to the developing section, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 0e382bc 11/62: Table: Completion, suggest columns inside fits, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 328ab31 19/62: Table: Completion, thoughts on short options, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master b5c4f29 27/62: Table: Completion, add options, improve get name, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 86df9d8 25/62: Table: Completion, custom compgen, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 51daecd 30/62: Table: Completion, update copyright, minor edits, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master e690fc5 37/62: Bash completion: renamed fixed file to completion.bash, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 229ac51 41/62: /bin/table/completion.bash: Refactor code, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 50026ec 48/62: Auto-completion: Rename boolean query functions,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 8150e1c 50/62: Auto-completion: Refactor FITS related functions, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master afadccf 52/62: Auto-completion: Call ..._last_table where needed, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 90f08c2 53/62: Auto-completion: Refactor ..._is_table function, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 4598eba 54/62: Auto-completion: clean re-implementation for Table, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 59669d9 61/62: Book: new section on known issues with Crop, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master b947f79 62/62: TAB completion: enabled in Fits program, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master acf58c1 58/62: TAB completion: now supported in ConvertType and Convolve, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 9ae830f 34/62: Table: Completion, replace double negative, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 7f1a203 35/62: Book: Autocompletion for developers example, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 6379566 36/62: Book: edits to the Bash auto-completion section, Mohammad Akhlaghi, 2021/05/13