From c082e115ed34cc2a42fab92b871fd2daa724f4d6c180caa06a8c81df10983aa3 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Thu, 12 Oct 2023 11:12:23 +0000 Subject: [PATCH] complete for manual pages OBS-URL: https://build.opensuse.org/package/show/shells/tcsh?expand=0&rev=162 --- complete.tcsh | 12 ++++++++---- tcsh.changes | 6 ++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/complete.tcsh b/complete.tcsh index 2696af6..9ff3801 100644 --- a/complete.tcsh +++ b/complete.tcsh @@ -10,6 +10,7 @@ # 1999/06/28: resort to the order to fit complete.tcsh # found in tcsh-6.08.05, add the mh completes. # + set _man_sections=(`\ls -1dfUA ${_manpath}*|sed s%/.\*/man%%|sort -u`) set autolist=ambiguous set noglob # @@ -703,11 +704,14 @@ skip_mh: n@-u@T:$_maildir@ n/-f/f/ n/*/u/ endif - complete man 'n@[0-9n]@`\ls -1fUA ${_manpath}$:-1/|&\sed \\%.\*:%d\;s%\\.$:-1.\*\$%%|\sort -u`@' \ + alias _list_man_pages \ + 'find ${_manpath:h} \( -type f -o -type l \) -printf "%f\n"|&sed -r "\%find:.*:%d;s%([^.]+).([^ ]*?)%\1%g"|sort -u' + complete man 'n@[0-9n]{,p,mp}@`\ls -1fUA ${_manpath}$:-1/|&sed \\%.\*:%d\;s%\\.$:-1.\*\$%%|sort -u`@' \ c@-@"(- f k M P s S t)"@ n@-f@c@ n@-k@x:''@ n/-l/f/ C@./*@f@ n@-[MP]@d@ \ - 'N@-[MP]@`\ls -1 $:-1/man? |&\sed -n s%\\..\\+\$%%p`@' \ - 'n@-[sS]@`\ls -1 ${_manpath:h}|&\sed -n \\%/.\*:%d\;s%man%%p|\sort -u`@' \ - 'n@*@`\find ${_manpath:h} \( -type f -o -type l \) -printf "%f\n"|&\sed -r "\%find:.*:%d;s%([^.]+).([^ ]*?)%\1%g"|\sort -u`@' + 'N@-[MP]@`\ls -1 $:-1/man? |&sed -n s%\\..\\+\$%%p`@' \ + 'n@-[sS]@`\ls -1 ${_manpath:h}|&sed -n \\%/.\*:%d\;s%man%%p|sort -u`@' \ + 'p@1@`echo ${_man_sections};eval _list_man_pages`@' \ + 'n@*@`eval _list_man_pages`@' complete ps c/-t/x:''/ c/-/"(a c C e g k l S t u v w x)"/ \ n/-k/x:''/ N/-k/x:''/ n/*/x:''/ complete compress c/-/"(c f v b)"/ n/-b/x:''/ n/*/f:^*.Z/ diff --git a/tcsh.changes b/tcsh.changes index 1298a89..fc53176 100644 --- a/tcsh.changes +++ b/tcsh.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 12 11:10:59 UTC 2023 - Dr. Werner Fink + +- Try to make complete for command man faster and support all + separate manual page sections + ------------------------------------------------------------------- Mon Oct 9 08:08:30 UTC 2023 - Dr. Werner Fink