[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 6fe9cb6 20/62: Table: Completion, refactor awk
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 6fe9cb6 20/62: Table: Completion, refactor awk regex fits name |
Date: |
Thu, 13 May 2021 22:20:48 -0400 (EDT) |
branch: master
commit 6fe9cb6008efd147cd22779f27bbfaaaaf381817
Author: Pedram Ashofteh Ardakani <pedramardakani@pm.me>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Table: Completion, refactor awk regex fits name
With this commit, a simpler regex is used for finding the fits files in
current directory.
Also, few other words are added about taking care of the short options.
---
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 d77f0f6..8718c7d 100644
--- a/bin/table/completion.sh
+++ b/bin/table/completion.sh
@@ -10,7 +10,8 @@
# autocompletion. Because only the advanced users may use them. And it is
# possible to mix them up. So, only those will use the short options who
# know what they are doing. Hence, they will not need the autocompletion
-# feature binded to the short options.
+# feature binded to the short options. However, the short options are
+# taken into consideration for suggesting the upcoming commands.
# TIP: Run the command below to initialize the bash completion feature for
# this specific program (i.e. astcosmiccal):
@@ -52,7 +53,7 @@ _gnuastro_autocomplete_get_fits_name(){
# Get the first fits file among the command line and put it into the
# $comp_fits_name variable
# TODO: How about all other fits file extensions?
- local file_name="$(echo ${COMP_WORDS[@]} | awk -v
regex="[a-zA-Z]*.[fF][iI][tT][sS]" 'match($0, regex) {print substr($0, RSTART,
RLENGTH)}')"
+ local file_name="$(echo ${COMP_WORDS[@]} | awk -v
regex=".[fF][iI][tT][sS]" 'match($0, regex) {print substr($0, RSTART,
RLENGTH)}')"
if [ -f "$file_name" ]; then
# Check if file_name is actually an existing fits file. This
# prevents other functions from failing and producing obscure error
- [gnuastro-commits] master c02ae2c 02/62: Completion: feed options from `help`, (continued)
- [gnuastro-commits] master c02ae2c 02/62: Completion: feed options from `help`, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master b06fbce 03/62: Completion: Fix indentations, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master a829b24 05/62: Completion: Suggest FITS files in relevant options, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 3da00c3 07/62: Table: Prepare initial completion script, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 477d23d 06/62: Rename completion files, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 39efeea 08/62: Table: First working completion, general commands, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 32cbe32 13/62: Table: Completion, better formatting, add function, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master d631f5b 15/62: Table: Completion, remove global variables, etc, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master f4cf33d 17/62: Tabel: Completion, examine for fits availability, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master e1c1a4b 18/62: Table: Completion, fix 'wcshdu', Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 6fe9cb6 20/62: Table: Completion, refactor awk regex fits name,
Mohammad Akhlaghi <=
- [gnuastro-commits] master c593823 23/62: Table: Completion, fix hdu and fits suggestions, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 0420521 04/62: Completion: bug fix in catching the options, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 3d8e96d 10/62: Table: Fix completion issue, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master f2ccd6e 12/62: Table: Completion, fix reading fits column, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master d0e1362 14/62: Table: Completion, better function name, copyright, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 7ad725a 21/62: Table: Completion, fix hdu and fits suggestions, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master b391ee8 22/62: Table: Completion, bash4+ long option no space, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 97d9a1e 09/62: Table: Completion suggests matching words, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 9ea367b 16/62: Table: Completion, handle '=', do not append space, Mohammad Akhlaghi, 2021/05/13
- [gnuastro-commits] master 7c95cec 24/62: Table: Completion, better POSIX portability, Mohammad Akhlaghi, 2021/05/13