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. --- TODO | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'TODO') diff --git a/TODO b/TODO index 1c732c5..01f78b8 100644 --- a/TODO +++ b/TODO @@ -1,16 +1,10 @@ TODO file for ctct [GENERAL] -* consider using an array for *_program to specify arguments - `- to circumvent the necessity for eval * Honor $VISUAL. +* Honor XDG user dirs. * Use git tags for future versions. -* On `ctct -s ', do not match illegal sequences (e.g. a+b). -* On `ctct -l', do only list legal names (e.g. not a+b). -* Use the EXIT_* variables. -* [consider] On `ctct -d', check format of string. * [consider] Remove character restriction except '.', '/'. -* [consider] Use `grep -F' for --search-by-name. * [consider] Require at least one argument for --search-by-*. [CONFIGURE SCRIPT] @@ -26,12 +20,11 @@ TODO file for ctct `- should be made customizable * [optional] Do not create a new entry if nothing is entered in the editor. * Support templates. -* Different return types for errors and non-matches. * Quiet option for --search-by-*. * [consider] Use another default editor. `- nano, easily understandable. `- ed, the editor. -* Honor XDG user dirs. +* [consider] Use regexes for --search-by-name. [MANUAL] * Add an EXAMPLE section to ctct(1). -- cgit v1.2.3