From 194052e67ed30121d7b66e8e7db559a32d001dab Mon Sep 17 00:00:00 2001 From: Einhard Leichtfuß Date: Tue, 25 Dec 2018 16:03:04 +0100 Subject: Prevent matching illegal sequences globally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit E.g., a+b will no longer be matched by anything. This is due to the global usage of a modified list_all(). Also: - Use different return types for different things (e.g. $RET_SUCCESS). `- Both internally and externally (exit codes, documented in ctct(1)). - Make --search-by-data more efficient. `- One call to grep for all files. `- The conjunction of the regexes still requires several calls. - Rename functions to more speaking names. - Document the function parameters. - Add vi modelines. - Use [[:alpha:]] instead of [A-Za-z] which appears to be the same but more clear. Notably, both seem to include non-ASCII letters, for example 'à'. - Set nullglob option in the script to prevent errors for cases where glob patterns would be used. - Add a silent option ro check_syntax() (not used). - Add a full_path option to list_all() (not used). - Use return instead of exit in main(). - Remove one remaining usage of eval. - Fix small format issue in ctct(1) (I -> B). `- They are no longer, but it hardly harms to have this option. --- ctct.1.in | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'ctct.1.in') diff --git a/ctct.1.in b/ctct.1.in index 5a9ba61..3ac3cb8 100644 --- a/ctct.1.in +++ b/ctct.1.in @@ -164,7 +164,7 @@ Show a simple help text basically depicting the above options\. .\" .SH EXIT STATUS .TP -.B 0 +.B @ret_success@ Successfull operation\. In case of .BR \-\-search\-by\-name @@ -173,22 +173,34 @@ or at least one matching entry was found\. .\" .TP -.B 1 -An error occurred or, in case of -.B \-\-search\-by\-name +.B @ret_failure@ +In case of +.BR \-\-search\-by\-name or .BR \-\-search\-by\-data , no matching entry was found\. +Elsewise, the action did not succeed, for example due to the requested name +not referring to an existing contact entry\. +.\" +.TP +.B @ret_badsyntax@ +The used command contains bad syntax which will fail under any conditions\. +.\" +.TP +.B @ret_error@ +An unexpected error occurred, for example due to missing permissions in +.BR datadir \. .\" .\" .SH ENVIROMENT .TP .B EDITOR -The editor to use when \fBctct\fP is called with the \fI\-\-edit\fP +The editor to use when \fBctct\fP is called with the \fB\-\-edit\fP option and \fBdefault_editor\fP is not set in \fBctct_config\fP(5)\. .\" .\" .SH SEE ALSO .BR ctct_config (5), .BR grep (1) +.\" .\" vi: tw=75 -- cgit v1.2.3