[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master ea08fdb 49/62: Auto-completion: return value f
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master ea08fdb 49/62: Auto-completion: return value from last table |
Date: |
Thu, 13 May 2021 22:20:53 -0400 (EDT) |
branch: master
commit ea08fdb3aeb6d0c9b9bc66334fe088efe11b4af6
Author: Pedram Ashofteh Ardakani <pedramardakani@pm.me>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Auto-completion: return value from last table
Until now, the _gnuastro_autocomplete_last_table function would not
return anything. It would just set a global variable. However, it might
be a better idea to use return values instead of breaking the loops.
Because later we can use the return value as a signal if need be.
---
bin/table/completion.bash | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/bin/table/completion.bash b/bin/table/completion.bash
index aeb0abb..ddb3618 100644
--- a/bin/table/completion.bash
+++ b/bin/table/completion.bash
@@ -303,16 +303,19 @@ _gnuastro_autocomplete_last_table(){
# break out of the loop that parses the tokens.
if $_gnuastro_asttable $token -h$last_table_hdu -i &>
/dev/null; then
last_table="$token"
- break;
+ return 0
fi
# Not a FITS file.
else
if _gnuastro_autocomplete_is_plaintext_table $token; then
last_table="$token"
- break;
+ return 0
fi
fi
+ else
+ # The file $token does not exist
+ return 1
fi
done
}
- [gnuastro-commits] master 6379566 36/62: Book: edits to the Bash auto-completion section, (continued)
- [gnuastro-commits] master 6379566 36/62: Book: edits to the Bash auto-completion section, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 9335953 44/62: Auto-completion: Faster fits parse, use 'local', Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 284a32e 51/62: Auto-completion: Debug -i, improve performance, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master e5707cd 28/62: Table: Completion, all options, update comments, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 88806f2 38/62: bin/table/completion.bash: improvements to find good table name, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 1bf469f 40/62: /bin/table/completion.bash: consider short opt '-i', Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master e340452 42/62: Auto-completion: Minor polishing of the warning message, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master e444941 45/62: Auto-completion: Call astfits/asttable consistently, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 04ee1fe 46/62: Auto-completion: Suggest plaintext tables too, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 3754f1b 47/62: Auto-completion: Human readable arguments, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master ea08fdb 49/62: Auto-completion: return value from last table,
Mohammad Akhlaghi <=
- [gnuastro-commits] master ece1614 55/62: Auto complete: separated generic functions from Table's recipe, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master ef351da 56/62: TAB completion: now working for Arithmetic, better infrastructure, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master d2bf2c2 60/62: TAB completion: updated documentation and polished the code, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 4412710 29/62: Table: Completions, add missing options from help, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 82e9692 33/62: Book: Update the auto-complete section, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master abe3ca6 43/62: Auto-completion: Smart list fits files, fix var, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master a66e8bb 57/62: TAB completion: BuildProgram support added, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master d7bf627 59/62: TAB completion: support added for CosmicCalculator and Crop, Mohammad Akhlaghi, 2021/05/13