gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 437e8587: Table: warning if --catcolumns is gi


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 437e8587: Table: warning if --catcolumns is given without --catcolumnfile
Date: Thu, 25 Aug 2022 10:25:16 -0400 (EDT)

branch: master
commit 437e8587501a1cb38e1177edad9cec6938ff3e51
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Table: warning if --catcolumns is given without --catcolumnfile
    
    Until now, if '--catcolumns' (or '-C') was called, but without
    '--catcolumnfile' (or '-L'), then the value given to '--catcolumns' would
    be silently ignored. This could cause confusion for the user. Especially
    since the use may have wanted '-c' and mistakenly written '-C'!
    
    With this commit, in such cases, a warning is printed by Table to standard
    error to let the user know about this option being ignored.
    
    This issue was suggested by Sepideh Eskandarlou.
---
 bin/table/ui.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/bin/table/ui.c b/bin/table/ui.c
index 415fb430..8d1ad18e 100644
--- a/bin/table/ui.c
+++ b/bin/table/ui.c
@@ -332,6 +332,15 @@ ui_read_check_only_options(struct tableparams *p)
         error(EXIT_FAILURE, 0, "at most three values can be given to each "
               "call of '--colmetadata' ('-m') after the original columns "
               "name or number. But %zu strings have been given", tmp->size);
+
+  /* If '--catcolumns' is given (to only concatenate certain columns), but
+     no file has been given for appending from (to '--catcolumnfile'), then
+     print a warning to let the user know (this may have been a typo!). */
+  if(p->cp.quiet==0 && p->catcolumns && p->catcolumnfile==NULL)
+    error(EXIT_SUCCESS, 0, "WARNING: '--catcolumns' (or '-C') is ignored "
+          "because '--catcolumnfile' (or '-L') was not given to specify "
+          "which file the new columns should come from. To supress this "
+          "warning, please run with '--quiet'");
 }
 
 



reply via email to

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