[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 1bf469f 40/62: /bin/table/completion.bash: con
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 1bf469f 40/62: /bin/table/completion.bash: consider short opt '-i' |
Date: |
Thu, 13 May 2021 22:20:51 -0400 (EDT) |
branch: master
commit 1bf469f8a9e314b36c359f6a898df7dfed821fdb
Author: Pedram Ashofteh Ardakani <pedramardakani@pm.me>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
/bin/table/completion.bash: consider short opt '-i'
The '--information' long and short option '-i' should have the same
autocompletion suggestions. With this commit, the autocompletion will
cease providing suggestions when '-i' or '--information' option is
selected while the fits file is specified.
I could have used the bash extended glob: @(pattern1|pattern2) in the
pattern matching binary operator '=~' inside the '[[ ... ]]' keyword.
But I refrained to do so, since we try not to use more modern operators
to keep the backward compatibility (for Bash older than 3.2 or so).
---
bin/table/completion.bash | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/table/completion.bash b/bin/table/completion.bash
index 2384b1b..2a8ad5d 100644
--- a/bin/table/completion.bash
+++ b/bin/table/completion.bash
@@ -388,7 +388,7 @@ _gnuastro_asttable_completions(){
# when a File has been given, and the information option is called, we
# should tell the user to avoid trying new options and just press ENTER
- if [[ "$COMP_LINE" =~ "--information" ]] && [ -f "$last_table" ]; then
+ if [ -f "$last_table" ] && [[ "$COMP_LINE" =~ "--information" ]] || [[
"$COMP_LINE" =~ " -i" ]]; then
printf "\nThe '--information' (or '-i') will disable all other
options, you can safely press ENTER now.\n%s" "$COMP_LINE"
COMPREPLY=()
else
- [gnuastro-commits] master 59669d9 61/62: Book: new section on known issues with Crop, (continued)
- [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
- [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 <=
- [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, 2021/05/13
- [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